diff --git a/Code/hello b/Code/output/hello similarity index 100% rename from Code/hello rename to Code/output/hello diff --git a/Code/output/printf b/Code/output/printf new file mode 100644 index 0000000..3b4d311 Binary files /dev/null and b/Code/output/printf differ diff --git a/Code/sizeof b/Code/output/sizeof similarity index 100% rename from Code/sizeof rename to Code/output/sizeof diff --git a/Code/test b/Code/output/test similarity index 100% rename from Code/test rename to Code/output/test diff --git a/Code/output/work1_0428 b/Code/output/work1_0428 new file mode 100644 index 0000000..4b1c717 Binary files /dev/null and b/Code/output/work1_0428 differ diff --git a/Code/output/work2_0428 b/Code/output/work2_0428 new file mode 100644 index 0000000..a163a96 Binary files /dev/null and b/Code/output/work2_0428 differ diff --git a/Code/printf.c b/Code/printf.c new file mode 100644 index 0000000..4c11e66 --- /dev/null +++ b/Code/printf.c @@ -0,0 +1,11 @@ +#include + +int main() +{ + int a; + printf("请输入一个数:\n"); + scanf("%d", &a); + printf("a: %d\n",a); + + return 0; +} \ No newline at end of file diff --git a/Code/work1_0428.c b/Code/work1_0428.c new file mode 100644 index 0000000..1dc90d7 --- /dev/null +++ b/Code/work1_0428.c @@ -0,0 +1,9 @@ +#include + +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; +} \ No newline at end of file diff --git a/Code/work2_0428.c b/Code/work2_0428.c new file mode 100644 index 0000000..b91199b --- /dev/null +++ b/Code/work2_0428.c @@ -0,0 +1,16 @@ +#include + +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; +} \ No newline at end of file