1 solutions
-
0
C :
#include<stdio.h> int main(){ int n; scanf("%d",&n); if(n%3==0 && n%5==0) printf("can\n"); else printf("cannot\n"); return 0;}C++ :
#include <stdio.h> int main() { int n; scanf("%d", &n); if (n % 3 == 0 && n % 5 == 0) printf("can\n"); else printf("cannot\n"); return 0; }Pascal :
var n:longint; begin readln(n); if (n mod 3=0)and(n mod 5=0) then writeln('can') else writeln('cannot'); end.Java :
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s=new Scanner(System.in); int a=s.nextInt(); if(a%3==0&&a%5==0){ System.out.println("can"); }else System.out.println("cannot"); } }Python :
n = input() if n%3==0 and n%5==0: print "can" else: print "cannot"C# :
using System; namespace C语言 { class _2_9 { private static void Main() { int n=int.Parse(Console.ReadLine()); if(n%3==0&&n%5==0) Console.WriteLine("can"); else Console.WriteLine("cannot"); Console.ReadLine(); } } }
- 1
Information
- ID
- 16367
- Time
- 1000ms
- Memory
- 32MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By