2021年7月29日

/*练习—02|2. 输入一个圆半径(r)当r>=0时,计算并输出圆的面积和周长,否则,输出提示信息。*/

摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 6 int t; 7 double r, s ,c; 8 9 do{ 10 printf ("请输入一个圆的半径值r: "); 11 scanf ("%lf", &r); 12 阅读全文

posted @ 2021-07-29 18:20 白珏神尊 阅读(2121) 评论(0) 推荐(0)

/*练习—01|求两个数的平方和并且输出*/

摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int a, b, sum; //另外一种写法也可以 6 printf("请分别输入两个数字:"); //printf("请输入一个数字a:") 7 //scanf("%d", 阅读全文

posted @ 2021-07-29 17:38 白珏神尊 阅读(367) 评论(0) 推荐(0)

冒泡排序

摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #define N 5 /*宏定义*/ 4 int main() 5 { 6 7 int i, j, t, a[N]; 8 9 for ( i = 0; i < N; i ++ ) /*循环N次输入这N个数字* 阅读全文

posted @ 2021-07-29 12:13 白珏神尊 阅读(54) 评论(0) 推荐(0)

导航