摘要: 1 、定义圆形半径,求面积。 package jkl; import java.util.Scanner; public class rew { public static void main(String[] args) { double r=77; double p=3.14; double S 阅读全文
posted @ 2023-03-17 16:26 云鹤銐 阅读(35) 评论(0) 推荐(0)
摘要: 1.编写程序,统计字符串中大写字母的个数 #include<stdio.h> main() { char str[20]; int i,j; i=j=0; gets(str); while(str[i]!='\0') { if(str[i]>='A'&&str[i]<='Z') j++; i++; 阅读全文
posted @ 2021-11-23 21:22 云鹤銐 阅读(44) 评论(0) 推荐(0)
摘要: 定义一个含有8个储存单元的实型数组,从键盘手上接收数据,然后逆序输出 #include<stdio.h> main() { double m[8]; int i; printf("请输入8个数"); for(i=0;i<=7;i++) scanf("%lf",&m[i]); for(i=7;i>=0 阅读全文
posted @ 2021-11-23 20:31 云鹤銐 阅读(12) 评论(0) 推荐(0)
摘要: 输出图形 #include<stdio.h> int main() { int f,g,i; for(i=1;i<=5;i++) { for(g=1;g<=i;g++) {printf("*");} printf("\n"); } for(i=6;i<=10;i++) {printf("\n");} 阅读全文
posted @ 2021-11-15 20:31 云鹤銐 阅读(24) 评论(0) 推荐(0)
摘要: 编写程序,使用while语句求和sum=1+2+3+4+…+21. #include<stdio.h> main() { int i=1;int sum=0; while(i<=21) { sum+=i; i+=2; } printf("sum=%d\n",sum); } 2.编写程序,使用whil 阅读全文
posted @ 2021-11-02 12:01 云鹤銐 阅读(23) 评论(0) 推荐(0)
摘要: 分数转成等级 switch #include<stdio.h> main() { int a; printf("请输入学生的分数(0-100):\n"); scanf("%d",&a); switch(a/10) { case 10: case 9:printf("A\n");break; case 阅读全文
posted @ 2021-10-30 14:38 云鹤銐 阅读(31) 评论(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("负数\n" 阅读全文
posted @ 2021-10-24 14:09 云鹤銐 阅读(40) 评论(0) 推荐(0)
摘要: #include<stdio.h> main() { int a=1; int b=2; printf("%d\n%d\n",a,b); } #include<stdio.h> main() { float a=1.23; double b=4.56; printf("%f\n%f\n",a,b); 阅读全文
posted @ 2021-10-12 10:52 云鹤銐 阅读(55) 评论(0) 推荐(0)
摘要: #include<stdio.h> main() { printf("赵成瑞\n"); } #include<stdio.h> main() { printf("我爱学C语言\n"); printf("计算机科学与技术\n"); printf(" ***\n"); printf("*\n"); pr 阅读全文
posted @ 2021-10-01 16:58 云鹤銐 阅读(19) 评论(0) 推荐(0)