/*#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函數(shù)中定義兩個變量并初始化,并交換兩個變量的值//#include32到45是想同時打印出"打印整數(shù)變量或者整形變量""打印浮點型常量或者浮點型變量"這兩句話//int main()//{ /*? int a = 1;? ? printf("打印整數(shù)變量或者整形變量%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的函數(shù)格式/*#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個位置?
}*/