摘要: 1.定义圆形半径,求面积 package shg; import java.util.Scanner; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub Sc 阅读全文
posted @ 2023-03-21 14:55 陆雲雲 阅读(49) 评论(0) 推荐(0)
摘要: 1.实现一个菜单 可以切换 ,可以返回主菜单 主菜单 1.登录 2.注册 3.输出水仙花 4.退出程序 请选择: #include<stdio.h>#include<string.h>void denglu();void zhuce();void shuixianhua();main(){ int 阅读全文
posted @ 2021-11-28 23:23 陆雲雲 阅读(45) 评论(0) 推荐(0)
摘要: 1.编写程序,统计字符串中大写字母的个数 #include<stdio.h> main() { char str[5]; int i,cnt; cnt=i=0; gets(str); while(str[i]!='\0') {if(str[i]>='A'&&str[i]<='Z') cnt++; i 阅读全文
posted @ 2021-11-28 22:54 陆雲雲 阅读(13) 评论(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",m[i]);} 阅读全文
posted @ 2021-11-28 22:40 陆雲雲 阅读(37) 评论(0) 推荐(0)
摘要: #include<stdio.h> main(){ int i,j; for(i=1;j<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } 2. #include<stdio.h> main(){ int i,j,k; for( 阅读全文
posted @ 2021-11-15 22:59 陆雲雲 阅读(63) 评论(0) 推荐(0)
摘要: 编写程序,使用while语句求和sum=1+3+5+…+21 #include<stdio.h> main(){ int i=1;int sum=0; while(i<=21) { sum+=i; i+=2; } printf("sum=%d\n",sum); } 2.编写程序,使用while语句求 阅读全文
posted @ 2021-11-07 22:20 陆雲雲 阅读(65) 评论(0) 推荐(0)
摘要: 1.书P52 例题4-8 #include<stdio.h> main() { int mark; printf("输入学生的分数(1-100):\n"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n");brea 阅读全文
posted @ 2021-10-30 22:47 陆雲雲 阅读(106) 评论(0) 推荐(0)
摘要: 编写程序,判断一个数n是正数还是负数 #include<stdio.h> main(){ float n; scanf("%f",&n); if(n>0) printf("正数!\n"); else if(n=0) printf("0既不是正数,也不是负数!\n"); else printf("负数 阅读全文
posted @ 2021-10-19 11:08 陆雲雲 阅读(42) 评论(0) 推荐(0)
摘要: 一,1.编写程序,定义两个整型变量,赋值并输出 #include<stdio.h>main(){ int x=15; int y=75; printf("%d %d\n",x,y);} 2.编写程序,定义一个单精度和一个双精度的变量,赋值并输出 #include<stdio.h>main(){ fl 阅读全文
posted @ 2021-10-12 16:25 陆雲雲 阅读(392) 评论(0) 推荐(0)
摘要: 1.编写程序,输出”我爱学习C语言!“ #include<stdio.h>main(){ printf("我爱学习C语言!");} 2.分行输出自己的专业和姓名 #include<stdio.h>main(){ printf("计算机科学与技术\n"); printf("陆雲雲\n");} 3.用* 阅读全文
posted @ 2021-10-01 16:25 陆雲雲 阅读(34) 评论(0) 推荐(0)