stu 发表于 2013-12-16 18:30 #include <stdio.h> #include <stdlib.h> int main() { int a,b; a=a+b; b=b-a; a=b+a; a=b; b=a; printf("%d %d",a,b); system("pause"); return 0; } |
#include <stdio.h> #include <stdlib.h> int main() { printf("☆\n"); printf("☆ ☆\n"); 这几个地方你用空格调整位置或者 printf("☆ ☆\n"); 或者用*号 代替星星也可以 printf("☆ ☆\n"); printf("☆\n"); system("color f5" ); system("pause"); return 0; } |
路过再顺便说一句 abs的原型声明在stdlib.h里,而不是math.h 所以应该做的是 #include <stdlib.h> |
问下书中44页 提到的 思考一下 为什么通过a=b-a;b=b-a;a=b+a;也可以将变量a与变量b中的值交换呢? 求解答 |
本帖最后由 Vivian1091 于 2013-12-16 13:28 编辑 这样可以吗 #include <stdio.h> #include <stdlib.h> int main() { printf(" *\n * *\n* *\n * *\n *"); system("pause"); return 0; } |