每次循環(huán)換就是1*1不連接到了2*2嗎?
為什莫是printf("\n");表示?
不要這個 為什莫只有一豎行
為什莫是printf("\n");表示?
不要這個 為什莫只有一豎行
2020-02-17
告訴大家
#include <stdio.h>
int main()
{
printf("sum=-50");
return 0;
}
也是對的
#include <stdio.h>
int main()
{
printf("sum=-50");
return 0;
}
也是對的
2020-02-17
大家知道嗎
#include <stdio.h>
int main()
{
printf("sum=-50");
return 0;
}
#include <stdio.h>
int main()
{
printf("sum=-50");
return 0;
}
2020-02-17
#include <stdio.h>
int main()
{
int sale=120; //銷售業(yè)績?yōu)?20萬
int year=1; //剛剛進(jìn)入公司1年
//完善代碼
if(sale>100)
if(year>=2)
{
printf("%s\n","恭喜獲得年終獎");
}
else
{
printf("%s\n","很遺憾期待你再接再厲");
}
else
{
printf("%s\n","很遺憾期待你再接再厲");
}
}
return 0;
}
int main()
{
int sale=120; //銷售業(yè)績?yōu)?20萬
int year=1; //剛剛進(jìn)入公司1年
//完善代碼
if(sale>100)
if(year>=2)
{
printf("%s\n","恭喜獲得年終獎");
}
else
{
printf("%s\n","很遺憾期待你再接再厲");
}
else
{
printf("%s\n","很遺憾期待你再接再厲");
}
}
return 0;
}
2020-02-16
#include <stdio.h>
int main()
{
int i,j,result;
for(i=9;i>0;i--)
{
for(j=1;j<i+1;j++)
{
result=j*i;
printf("%d*%d=%d\t",i,j,result);
}
putchar('\n');
}
return 0;
}
完美了,?愛了
int main()
{
int i,j,result;
for(i=9;i>0;i--)
{
for(j=1;j<i+1;j++)
{
result=j*i;
printf("%d*%d=%d\t",i,j,result);
}
putchar('\n');
}
return 0;
}
完美了,?愛了
2020-02-16
#include <stdio.h>
int main()
{
double numone = 2.5; //定義浮點型變量num并賦值為2.5
int numtwo=(int)numone;
printf("num的整數(shù)部分是%d\n", numtwo);
return 0;
}
int main()
{
double numone = 2.5; //定義浮點型變量num并賦值為2.5
int numtwo=(int)numone;
printf("num的整數(shù)部分是%d\n", numtwo);
return 0;
}
2020-02-16
#include <stdio.h>
#define a 97
int main()
{
char c = 'a';
int n ; //將c賦值給n
float f ; //將c賦值給f
double d ; //將c賦值給d
n=c;
f=n;
d=n;
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
#define a 97
int main()
{
char c = 'a';
int n ; //將c賦值給n
float f ; //將c賦值給f
double d ; //將c賦值給d
n=c;
f=n;
d=n;
printf("%d\n",n);
printf("%f\n",f);
printf("%lf\n",d);
return 0;
}
2020-02-16
8行 printf("小明現(xiàn)在在慕課網(wǎng)上學(xué)習(xí)IT技術(shù)%C");
2020-02-16
兩個思路:
要么:在printLine()前加個extern,在test.c 的say()前加個static
要么:把hello.c的#include “test.c”刪掉
因為當(dāng)運行#include “test.c”時相當(dāng)于把test.c的函數(shù)導(dǎo)入到hello.c,需要把hello.c中的say()從外部函數(shù)改為內(nèi)部函數(shù),否則printLine就不知道是要調(diào)用導(dǎo)入到hello.c里的say()還是原本在test.c里的say()。就是產(chǎn)生了兩個say(),需要把其中一個say()屏蔽掉。
要么:在printLine()前加個extern,在test.c 的say()前加個static
要么:把hello.c的#include “test.c”刪掉
因為當(dāng)運行#include “test.c”時相當(dāng)于把test.c的函數(shù)導(dǎo)入到hello.c,需要把hello.c中的say()從外部函數(shù)改為內(nèi)部函數(shù),否則printLine就不知道是要調(diào)用導(dǎo)入到hello.c里的say()還是原本在test.c里的say()。就是產(chǎn)生了兩個say(),需要把其中一個say()屏蔽掉。
2020-02-15