摘要: public class text1 { public static void main(String[] args) { // TODO Auto-generated method stub int r=4; double pai=3.14; double area; area=pai*r*r; 阅读全文
posted @ 2023-07-03 22:11 王欣彤 阅读(25) 评论(0) 推荐(0)
摘要: 1.编写程序,使用scanf()接收整型·实型·字符型的变量,并分行依次输出。 #include <stdio.h> main() { int a=1; float b=2; char c='5'; printf("%d\n%f\n%c\n",a,b,c); } 2.编写程序,通过scanf()函数 阅读全文
posted @ 2021-12-09 17:35 王欣彤 阅读(35) 评论(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,y; f 阅读全文
posted @ 2021-12-08 22:36 王欣彤 阅读(18) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <string.h> void mainMenu(); void login(); void regist(); void shuiXianHua(); void returnToMenu(); main() { mainMenu(); } v 阅读全文
posted @ 2021-12-08 22:23 王欣彤 阅读(20) 评论(0) 推荐(0)
摘要: #include <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' ) 阅读全文
posted @ 2021-12-08 22:18 王欣彤 阅读(15) 评论(0) 推荐(0)
摘要: #include <stdio.h> main() { int a[8], i, j; for (i = 0; i < 8; i++) { printf("请输入第 %d数字", i + 1); scanf_s("%d", &a[i]); } for (j = 7; j >= 0; j--) { p 阅读全文
posted @ 2021-12-01 21:15 王欣彤 阅读(20) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> int main() { int a, n; srand((unsigned)time(NULL)); a = rand() % 100 + 1; printf("请输入你心里的所想的数:") 阅读全文
posted @ 2021-11-30 19:38 王欣彤 阅读(44) 评论(0) 推荐(0)
摘要: #include <stdio.h> main() { int x, y; for (x = 0; x <= 35; x++) { y = 35 - x; if (2 * x + 4 * y == 94) printf("鸡:%d只 兔子:%d只\n", x, y); } } #include <s 阅读全文
posted @ 2021-11-09 10:29 王欣彤 阅读(23) 评论(0) 推荐(0)
摘要: #include<stdio.h> main() { int n; printf("请输入一个数:\n"); scanf("%d",&n); if(n>0) printf("%d是正数!\n",n); else if(n==0) printf("%d既不是正数,也不是负数\n",n); else p 阅读全文
posted @ 2021-11-02 08:15 王欣彤 阅读(17) 评论(0) 推荐(0)
摘要: .编写程序,判断一个数n是正数还是负数 #include<stdio.h> main() { float n; scanf("%f",&n); if(n>0) printf("正数!\n"); else if (n==0) printf("既不是正数也不是负数\n"); else printf("负 阅读全文
posted @ 2021-10-22 12:59 王欣彤 阅读(28) 评论(0) 推荐(0)