C++ 程序:计算明天的星期几
#include
int main() { int today; cin >> today;
int tomorrow = (today + 1) % 7;
if (tomorrow == 0) {
tomorrow = 7;
}
cout << tomorrow << endl;
return 0;
}
原文地址: http://www.cveoy.top/t/topic/dr1E 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
#include
int main() { int today; cin >> today;
int tomorrow = (today + 1) % 7;
if (tomorrow == 0) {
tomorrow = 7;
}
cout << tomorrow << endl;
return 0;
}
原文地址: http://www.cveoy.top/t/topic/dr1E 著作权归作者所有。请勿转载和采集!