//c语言小白 哪里写的不好望各位点评 #include<stdio.h> int main() { int year = 2019; int i = 0; int count = 0; for(i = 1;i<=year;i++) { if(i%10 == 9) count++; else if(i/10%10 == 9) count++; else if(i/100%10 == 9) count++; } printf("%d",count); return 0; }
//c语言小白 哪里写的不好望各位点评 #include<stdio.h> int main() { int year = 2019; int i = 0; int count = 0; for(i = 1;i<=year;i++) { if(i%10 == 9) count++; else if(i/10%10 == 9) count++; else if(i/100%10 == 9) count++; } printf("%d",count); return 0; }