add homework
This commit is contained in:
parent
6e8729df55
commit
ad3d74f0fe
BIN
Code/output/printf
Normal file
BIN
Code/output/printf
Normal file
Binary file not shown.
BIN
Code/output/work1_0428
Normal file
BIN
Code/output/work1_0428
Normal file
Binary file not shown.
BIN
Code/output/work2_0428
Normal file
BIN
Code/output/work2_0428
Normal file
Binary file not shown.
11
Code/printf.c
Normal file
11
Code/printf.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include<stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
printf("请输入一个数:\n");
|
||||
scanf("%d", &a);
|
||||
printf("a: %d\n",a);
|
||||
|
||||
return 0;
|
||||
}
|
9
Code/work1_0428.c
Normal file
9
Code/work1_0428.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include<stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
printf("a:\n八进制:%o\n十进制:%d\n十六进制:%x\n字符:%c\n\n",'a','a','a','a');
|
||||
printf("B:\n八进制:%o\n十进制:%d\n十六进制:%x\n字符:%c\n",'B','B','B','B');
|
||||
|
||||
return 0;
|
||||
}
|
16
Code/work2_0428.c
Normal file
16
Code/work2_0428.c
Normal file
@ -0,0 +1,16 @@
|
||||
#include<stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
char name1[20],name2[20];
|
||||
char sex1,sex2;
|
||||
int id1,id2,grade1,grade2;
|
||||
printf("请输入第一个同学的(用空格分隔):姓名 学号 性别(M代表男性W代表女性) 成绩\n");
|
||||
scanf("%s %d %c %d",name1,&id1,&sex1,&grade1);
|
||||
printf("请输入第二个同学的(用空格分隔):姓名 学号 性别(M代表男性W代表女性) 成绩\n");
|
||||
scanf("%s %d %c %d",name2,&id2,&sex2,&grade2);
|
||||
printf("第一个同学的信息:\n姓名:%s\n学号:%d\n性别:%c\n成绩:%d\n",name1,id1,sex1,grade1);
|
||||
printf("第二个同学的信息:\n姓名:%s\n学号:%d\n性别:%c\n成绩:%d\n",name2,id2,sex2,grade2);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user