#include
int main() { int year=2014 if(year % 4 == 0 && year % 100 !=0 || year % 400 == 0 ) { printf("s%\n","今年是闰年"); } else { printf("s%\n","今年是平年"); } return 0; }这个错了吗#include<stdio.h> int main() { int year=2014; if(year%4==0) { printf("%s/n""今年是闰年"); } else { printf("%s/n""今年是平年"); return 0; }
int year=2014
这一行缺少分号。
是%s不是s%
#include <stdio.h> int main() { int year=2014; if(year % 4 == 0 && year % 100 !=0 || year % 400 == 0 ) { printf("%s\n","今年是闰年"); } else { printf("%s\n","今年是平年"); } return 0; }