1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n%3==0&&n%5!=0)cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
Java :
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a = sc.nextInt(); if(a%3==0 && a%5==0) { System.out.println("No"); }else if(a%3==0){ System.out.println("Yes"); }else { System.out.println("No"); } } }
Python :
n = int(input()) if n % 3 == 0 and n % 5 != 0: print('Yes') else: print('No')
- 1
Information
- ID
- 10211
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By