随笔分类 -  C prime plus 编程练习

摘要:1、 #include <stdio.h> #include <stdlib.h> int main() { int ch; int count = 0; FILE * fp; char fname[50]; printf("请输入文件名:\n"); scanf("%s", fname); getc 阅读全文
posted @ 2019-11-12 21:24 一颗蘋果 阅读(220) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> #include <string> int main() { char ch; int space_1 = 0; int break_1 = 0; int other_1 = 0; printf("请输入字符:"); while ((ch=getchar( 阅读全文
posted @ 2019-11-07 14:31 一颗蘋果 阅读(251) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> #include <string> int main() { char ch[26]; ch[0] = 'a'; for (int i = 1; i < 26; i++) { ch[i] = 'a' + i; } for (int i = 0; i < 2 阅读全文
posted @ 2019-11-05 17:00 一颗蘋果 阅读(222) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> #include <string> #define H_PER_M 60 int main() { int min, hour; printf("请输入分钟数:"); scanf("%d", &min); getchar(); while (min > 0 阅读全文
posted @ 2019-11-05 08:25 一颗蘋果 阅读(360) 评论(1) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main() { char a[10] = { 0 }; char b[10] = { 0 }; printf("请输入您的姓名:"); scanf("%s,%s", a, b); getchar(); printf("欢迎您%s,%s",a, b 阅读全文
posted @ 2019-11-04 19:45 一颗蘋果 阅读(268) 评论(1) 推荐(0) 编辑
摘要:2、 #include <stdio.h> int main() { char ch; printf("请输入一个数字:"); scanf("%d", &ch); getchar(); // 删除输入缓冲区中的回车键,否则会闪退 printf("它的字符为%c\n",ch); getchar(); 阅读全文
posted @ 2019-11-04 09:21 一颗蘋果 阅读(185) 评论(0) 推荐(0) 编辑
摘要:7、 #include <stdio.h> void smile(); int main() { int i, j = 0; for (j = 0; j < 3; j++) { for (i = 3; i > j; i--) { smile(); printf("\t"); } printf("\n 阅读全文
posted @ 2019-11-03 15:11 一颗蘋果 阅读(172) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示