解题思路:
注意事项:
参考代码:
#include<stdio.h> int count=0; int cishu=0; int n; int nextCourse(int course) { if(course==1) { // printf("政"); ++count; if(count==n) { --count; ++cishu; cishu=cishu%7654321; return 0; } else nextCourse(2); --count; return 0; } if(course==4) { // printf("综"); ++count; if(count==n) { --count; ++cishu; cishu=cishu%7654321; return 0; } else nextCourse(3); --count; return 0; } if(course==2) { // printf("历"); ++count; if(count==n) { --count; ++cishu; cishu=cishu%7654321; return 0; } else { nextCourse(1);nextCourse(3); } --count; return 0; } if(course==3) { // printf("地"); ++count; if(count==n) { --count; ++cishu; cishu=cishu%7654321; return 0; } else { nextCourse(2);nextCourse(4); } --count; return 0; } } int main() { scanf("%d",&n); // 1:政治,2:历史,3:地理,4:综合 nextCourse(1); printf("%d",cishu%7654321); return 0; }
0.0分
2 人评分
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:611 |
C语言训练-计算1977!* (C++代码)浏览:848 |
简单的a+b (C语言代码)浏览:573 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:748 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:676 |
WU-陶陶摘苹果2 (C++代码)浏览:968 |
打印十字图 (C语言代码)浏览:2701 |
DNA (C语言代码)浏览:745 |
输出九九乘法表 (C语言代码)浏览:1048 |
第三届阿里中间件性能挑战赛-总决赛亚军比赛攻略浏览:1144 |