#include <iostream>
using namespace std;
int main(){
int a,i=1;
while(i<=2){
cin>>a;
if(a%4==0&&a%100!=0||a%400==0) cout<<"閏年"<<endl;
else cout<<"平年"<<endl;
i++;
}
return 0;}
#include
using namespace std;
int main(){
int a,i=1;
while(i<=2 cin>>a){
cin>>a;
if(a%4==0&&a%100!=0||a%400==0) cout<<"閏年"<<endl;
else cout<<"平年"<<endl;
i++;
}
return 0;}
試試看把"i=1"去掉,把"while(i<=2)"改成"while(cin>>a)",再把"cin>>a;"和最後的"i++;"去掉
P.S.希望你看得懂
#include
using namespace std;
int main(){
int a,i=1;
while(i<=2 cin>>a){
cin>>a;
if(a%4==0&&a%100!=0||a%400==0) cout<<"閏年"<<endl;
else cout<<"平年"<<endl;
i++;
}
return 0;}
試試看把"i=1"去掉,把"while(i<=2)"改成"while(cin>>a)",再把"cin>>a;"和最後的"i++;"去掉
P.S.希望你看得懂
謝謝你的幫助。