摘要: 1.编写程序输入一个三位数,求出个位,十位,百位. #include<stdio.h> main(){ int i,a,b,c; printf("输出一个三位数\n"); scanf("%d",&i); a=i/100; b=i%100/10; c=i%10; printf("%d,%d,%d",a 阅读全文
posted @ 2021-12-02 09:51 Berial127 阅读(50) 评论(0) 推荐(0)
摘要: 1.实现一个菜单 可以切换 ,可以返回主菜单 主菜单 1.登录 2.注册 3.输出水仙花数 4.退出程序 请选择: 选择后实现对应的功能 #include <stdio.h> void mainMenu(); void login(); void returnToMain(); void regis 阅读全文
posted @ 2021-12-02 09:37 Berial127 阅读(19) 评论(0) 推荐(0)
摘要: 随机打个数判断大小 #include<stdio.h> #include <stdlib.h> #include <time.h> int main() { while(1){ int a=0,b; srand((unsigned)time(NULL)); a = rand()%100+1; pri 阅读全文
posted @ 2021-12-02 09:23 Berial127 阅读(34) 评论(0) 推荐(0)
摘要: 1.定义一个含有8个储存单位的实型数组 #include<stdio.h> main() { double m[8]; int i; for (i=0;i<=7;i++) scanf("%lf",&m[i]); for(i=7;i>=0;i--) printf("%f\n",m[i]); } 2。使 阅读全文
posted @ 2021-11-23 09:38 Berial127 阅读(32) 评论(0) 推荐(0)
摘要: 1.#include <stdio.h> main() { char str[20]; int i=0,cnt; cnt=i=0; gets(str); while(str[i]!='\0') { if(str[i]>='A'&&str[i]<='Z') cnt++; i++; } printf(" 阅读全文
posted @ 2021-11-23 09:37 Berial127 阅读(23) 评论(0) 推荐(0)
摘要: #include<stdio.h> main(){ int i,j; for(i=1;i<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } #include<stdio.h> main(){ int i,j,k; for(i=1 阅读全文
posted @ 2021-11-09 13:05 Berial127 阅读(33) 评论(0) 推荐(0)
摘要: #include<stdio.h>main(){ int mark; printf("输入分数:\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n");break; case 8:printf("B\n");b 阅读全文
posted @ 2021-10-29 13:36 Berial127 阅读(52) 评论(0) 推荐(0)
摘要: 1.输入两个数字,输出较大的数字。 #include <stdio.h> main() { int m,n; printf("请输入两个数字"); scanf("%d,%d",&m,&n); if(m>n) printf("%d",m); else printf("%d",n); } 2.请输入一个 阅读全文
posted @ 2021-10-25 08:29 Berial127 阅读(46) 评论(0) 推荐(0)
摘要: 1,编写程序,使用scanf()函数接收整型,实型,字符型的变量,并分行依次输出。 main() { int a;#include<stdio.h> float b; char c; scanf("%d%f%c",&a,&b,&c); printf("%d\n%f\n%c\n",a,b,c); } 阅读全文
posted @ 2021-10-17 17:19 Berial127 阅读(90) 评论(0) 推荐(0)
摘要: 1编写程序,定义两个整型变量,赋值并输出 #include<stdio.h> main() { int a=2,b=6; printf(" %d, %d",a,b); } 2编写程序,定义一个单精度和双精度的变量,赋值并输出 #include<stdio.h> main() { float a=1. 阅读全文
posted @ 2021-10-14 23:29 Berial127 阅读(73) 评论(0) 推荐(0)