/*#includeint main(){ int a = 1; int b = 2; int c; printf("交换前a的值是%d,b的值是%d\n",a,b); c = a; a = b; b = c; printf("交换后a的值是%d,b的值是%d\n",a,b);}*/ /*int main(){ int a = 1; int b = 3; int c; printf("交换前a的值是%d,b是%d\n",a,b);//warning:implicitly declaring library function 'printf' with type 'int (const char * ...)' 指出printf在字典上的意思和什么冲突? c = a; a = b; b = c; printf("交换后a的值是%d,b是%d\n",a,b);}*///定义两个变量并还原,并使两个变量的值交换;在main函数中定义两个变量并初始化,并交换两个变量的值//#include32到45是想同时打印出"打印整数变量或者整形变量""打印浮点型常量或者浮点型变量"这两句话//int main()//{ /* int a = 1; printf("打印整数变量或者整形变量%d\n",a);// return 0;} *//* float f();//这个可以没有QWQ float a = 1.3f; printf("打印浮点型常量或者浮点型变量%.3f\n",a); return 0;}*//*#includeint main(){char a = 'w'; printf("打印单个字符变量或者常量%c\n",a); return 0;}*//*随便试了几个,不知道哪个是字符串 囧#includeint main(){ static a = "我love你~~"; printf("打印单个字符变量或者常量%s\n",a); return 0;}*///计算两个整形变量相加,printf的函数格式/*#includeint add (int a,int b){ return a + b;}int main(){ int count; int a = 1000000000; int b = 1000; count = add (a,b); printf("这是a和b两个变量的和______%d\n",count); return 0; }*//*#includeint add (int a,int b)
{
return a + b;
}
int main ()
{
int a =500;
int b =20;
int count;
count = add (a,b);
printf("这是两个整形变量的和20%d\n",count);//这里能不能直接写8来表示右对齐8个位置?
}*/