题目 解决代码及点评 #include <stdio.h> #include <stdlib.h> void main() { // print是输出函数,参数%s表示输出字符串,而%-10s表示输出的字符串占10个位置,不足则补空格 printf("%-10s %-10s %-10s %-10s %-10s\n","name","number", "math" , "english&q…
 题目 解决代码及点评 #include <stdio.h> #include <stdlib.h> void swap(int *a,int *b) { *a = *a ^ *b; *b = *a ^ *b; *a = *a ^ *b; } void main() { int a, b, c; printf("input three data:\n"); scanf_s("%d%d%d",&a,&b,&c); p…
 题目 解决代码及点评 /* 编一程序,打入月份号,输出该月的英文月名. 例如,输入"3",则输出"March",要求用指针数组处理. */ #include <stdio.h> #include <stdlib.h> void main() { int i; char *a[12]={"January","February","March","April",…
  题目 解决代码及点评 这个是一道经典的教科书题目,基本上每本基础的c/c++语言教科书都会有这个题目 用来演示循环语句 #include <stdio.h> #include <stdlib.h> #include <math.h> void main() { int x; int num=1; printf("please input x\n"); scanf_s("%d",&x); for (int i=1…
题目 解决代码及点评 #include <stdio.h> #include <stdlib.h> void main() { float f; float c; float k; printf("please input the f\n"); scanf_s("%f", &f); // 注意不能写成5/9*(f-32),5/9两个整数相除结果是0 c = (f - 32) * 5 / 9; k = 273.16 + c; print…
   题目 解决代码及点评 在已经知道素数是怎么判断的基础上,增加循环,可以判断出100以内的素数 /************************************************************************/ /* 9. 打印1-100之间所有素数 */ /************************************************************************/ #include <stdio.h> #…