实验任务1 #include<stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); return 0; }
实验任务1_1.c
#include<stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); printf(" o \n"); printf("<H>\n"); printf("I I\n"); return 0; }
实验任务1_2.c #include<stdio.h> int main() { printf(" o o \n "); printf("<H> <H>\n" ); printf("I I I I\n"); return 0; }
实验任务2
//1+2+3+…+n(n的取值在100以内) //用数学归纳法(求和公式计算) #include<stdio.h> int main() { int n , sum; //从键盘输入一个十进制整数给n scanf("%d",&n); //待补足代码 //xxx //打印输出求和结果 printf("sum=%d\n,sum"); return 0; }
实验任务3
#include<stdio.h> int main() { int a,b,t; a=3; b=4; printf("a=%d,b=%d\n", a,b); t=a; a=b; b=t; printf("a=%d,b=%d\n",a,b); return 0; }
实验任务4
#include<stdio.h> int main() { int x,t,m; x = 123; printf("x = %d\n",x); t = 0; m = x % 10; t = t * 10 + m; x = x / 10; m = x % 10; t = t * 10 + m; x = x / 10; m = x % 10; t = t * 10 + m; x = x / 10; printf("t = %d\n",t); return 0; }
实验任务5
标签:10,main,return,int,实验,printf,include From: https://www.cnblogs.com/changdudingqing/p/17198693.html