摘要: 1.定义圆形半径,求面积 package diercizuoye; import java.util.Scanner; public class Timu1 { public static void main(String[] args) { // TODO Auto-generated metho 阅读全文
posted @ 2023-03-20 12:16 澄憕 阅读(9) 评论(0) 推荐(0)
摘要: 编写程序,接收一名学生的数学、外语、计算机三科成绩,并输出总分sum和平均分average(精确到两位小数)。 #include<stdio.h> main() { int A,B,C,sum; float average; printf("请输入数学,英语,计算机成绩\n"); scanf("%d 阅读全文
posted @ 2021-12-08 21:16 澄憕 阅读(67) 评论(0) 推荐(0)
摘要: 1.输入一个三位数,求个位,十位,百位。 #include<stdio.h> main() { int a,b,c,S;printf("请输入一个三位数\n"); scanf("%d",&S); c=S/100; b=(S/10)%10; a=S%10; printf("该三位数个位为%d,十位为% 阅读全文
posted @ 2021-12-08 21:15 澄憕 阅读(45) 评论(0) 推荐(0)
摘要: 1.实现一个菜单. #include <stdio.h> #include <string.h> void mainMenu(); void login(); void regist(); void shuiXianHua(); void returnToMenu(); main() { mainM 阅读全文
posted @ 2021-12-08 21:14 澄憕 阅读(13) 评论(0) 推荐(0)
摘要: clude <stdio.h> main() { char str[80]; int i=0; int cnt=0; printf("请输入你的字母:"); gets(str); while ( str[i]!=0 ) { if ( str[i]>='A'&&str[i]<='Z' ) cnt++; 阅读全文
posted @ 2021-12-08 21:12 澄憕 阅读(14) 评论(0) 推荐(0)
摘要: 1、定义一个含有8个存储单元的实行数组,从键盘上接收数,然后逆序输出 #include <stdio.h> main() { int a[8],i,j; for( i=0;i<8;i++ ) { printf( "请输入第 %d数字",i+1 ); scanf( "%d",&a[i] ); } fo 阅读全文
posted @ 2021-12-08 21:11 澄憕 阅读(15) 评论(0) 推荐(0)
摘要: 1. 猜数字:随机产生一个0-99的数,猜猜看如果大了就提示大了点如果小了就提示小了点直到猜对为止 #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int a,n; srand((unsigned)time( 阅读全文
posted @ 2021-12-08 21:09 澄憕 阅读(14) 评论(0) 推荐(0)
摘要: 1.P121 1 #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]); } 2.P121 2 #include< 阅读全文
posted @ 2021-12-08 21:04 澄憕 阅读(34) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> main() { int i,j; for(i=1;i<=6;i++) { for(j=1;j<=i-1;j++) printf("*"); printf("\n"); } } #include<stdio.h> main(){ int i,j,k; for( 阅读全文
posted @ 2021-11-11 12:42 澄憕 阅读(29) 评论(0) 推荐(0)
摘要: 编写程序,使用while语句求和sum=1+2+3+…+21。 #include <stdio.h> main() { int i=1,sum=1; while (i<=21){ sum=sum+i; i++; } printf("和是%d\n",sum); } 2. 编写程序,使用while语句求 阅读全文
posted @ 2021-11-06 18:24 澄憕 阅读(35) 评论(0) 推荐(0)