摘要: 1、定义圆形半径,求面积。 import java.util.Scanner; public class test1 { public static void main(String[] args) { // TODO Auto-generated method stub int a=8,r=10; 阅读全文
posted @ 2023-03-22 21:53 czy风继续吹 阅读(32) 评论(0) 推荐(0)
摘要: 1.编写程序,统计字符串中大写字母的个数。 #include<stdio.h> main(){ char a[10]; int b=0,c=0; gets(a); while(a[b]!='\0') { if(a[b]>='A'&&a[b]<='Z') c++; b++; } printf("%d\ 阅读全文
posted @ 2021-12-06 20:37 czy风继续吹 阅读(29) 评论(0) 推荐(0)
摘要: 1.编写程序,判断一个数n是正数还是负数。 #include<stdio.h> main(){ int n; scanf("%d",&n); if(n>0) printf("正"); else if(n==0) printf("非正非负"); else printf("负"); } 2.编写程序,计 阅读全文
posted @ 2021-12-06 20:34 czy风继续吹 阅读(15) 评论(0) 推荐(0)
摘要: 定义一个含有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[ 阅读全文
posted @ 2021-11-16 09:59 czy风继续吹 阅读(46) 评论(0) 推荐(0)
摘要: 1.输入以下图形 (1)#include<stdio.h> main() { int i,j; for(j=1;j<=8;j++){ for(i=1;i<=j-1;i++){ printf("* "); } printf("\n"); } } (2)#include<stdio.h> main() 阅读全文
posted @ 2021-11-09 10:18 czy风继续吹 阅读(18) 评论(0) 推荐(0)
摘要: 1.编写程序判断n是正数还是负数。 #include<stdio.h> main() { int n; printf("请输入一个整数:\n"); scanf("%d",&n); if(n>0) printf("%d是正数!\n",n); else if(n==0) printf("%d既不是正数, 阅读全文
posted @ 2021-10-31 12:44 czy风继续吹 阅读(52) 评论(0) 推荐(0)
摘要: 1.例4-8 #include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n");break; case 阅读全文
posted @ 2021-10-28 22:22 czy风继续吹 阅读(19) 评论(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 print 阅读全文
posted @ 2021-10-24 11:58 czy风继续吹 阅读(27) 评论(0) 推荐(0)
摘要: 编写程序,定义两个整型变量,赋值并输出。 #include<stdio.h> main() { int a=2; int b=6; printf("%d%d\n",a,b); } 2. 编写程序,定义一个单精度和一个双精度的变量,赋值并输出。 #include<stdio.h> main() { f 阅读全文
posted @ 2021-10-14 16:43 czy风继续吹 阅读(20) 评论(0) 推荐(0)
摘要: include<stdio.h> main() { printf("我爱学习C语言!"); } #include<stdio.h> main() printf("计算机科学与技术\n"); printf("程智煜\n"); } #include<stdio.h> main() { printf("H 阅读全文
posted @ 2021-10-07 11:20 czy风继续吹 阅读(21) 评论(0) 推荐(0)