Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
113961 石茂诤 能否被3和5整除 C Compile Error 0 MS 0 KB 174 2025-03-18 13:19:37

Tests(0/0):


Code:

#include <stdio.h> int main(){ long n; scanf("%d",&n); if (n % 3 == 0 and n % 5 == 0){ printf("can"); } else{ printf("cannot"); } return 0; }


Run Info:

Main.c: In function 'main':
Main.c:5:8: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long int *' [-Wformat=]
  scanf("%d",&n);
        ^
Main.c:7:17: error: expected ')' before 'and'
  if (n % 3 == 0 and n % 5 == 0){
                 ^
Main.c:5:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ^