![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言简单程序
yuan_teacher30
这个作者很懒,什么都没留下…
展开
-
求5的阶乘、求1+2+...+100的值(while即当型循环的用法)
#include <stdio.h>int main(){ int i, t; i = 1; t = 2; while (t <= 5) { i = i * t; t = t + 1; } printf("%d\n",i); return 0;}while意思是当,即当t<=5时,执行第二个大括号中的内容。原创 2022-04-02 16:10:57 · 2446 阅读 · 0 评论 -
求两个整数之和、两个数中的较大者
#include<stdio.h>int main(){ int a, b, sum; a = 123; b = 456; sum = a + b; printf("sum is %d\n",sum); return 0;}#include<stdio.h>//int main(){ int max(int x, int y); int a, b, c; scanf("%d,%d", &a, &b); c = max(..原创 2022-03-30 20:14:20 · 338 阅读 · 0 评论