}
12.#include
int Pow(int n);
int main(void) { }
int Pow(int n) { }
13.#include
int main(void) {
double first[L], second[L]; int index;
printf(\,L); for(index = 0;index < L; index++)
scanf(\,&first[index]); for(index = 0;index < L; index++) int pow, i; pow = 1;
for(i = 1; i <= n; i++)
pow *= 2; return pow; return 0; int Array[L]; int index = 0;
for(index = 0; index < L; index++) { }
index = 0; do
printf(\,Array[index]); while(++index<8); printf(\);
Array[index] = Pow(index);//使用头文件#include
}
printf(\,first[index]);
printf(\); second[0] = first[0];
for(index = 1;index < L; index++)
second[index] = second[index-1] + first[index]; printf(\,second[index]); for(index = 0;index < L; index++) return 0;
14.#include
int main(void) { }
15.#include
int main(void) {
while(De <= Da) { }
printf(\,years,De,Da);
Da += SM * K; De += De * L; years++; int years = 0; double Da = SM; double De = SM; char string[L]; int index;
printf(\);
for(index = 0; index < L; index++)
scanf(\,&string[index]); printf(\);
for(index = L-1; index >= 0; index--)
return 0;
printf(\,string[index]); printf(\);
}
return 0;
16.#include
int main(void) { } 第七章 复习题:
1.false;true;false.
2.a.number >= 90 && number < 100 b.ch != ?q?&& ch != ?k?
c.number >= 1 && number <=8 && number != 5 d.number < 1 || number > 9 3.#include
int main(void) { }
4.a.1;b.0;c.1;d.6;3.10;f.0.
scanf(\, &weight, &height); if(weight < 100 && height > 64) { }
elseif(weight > 300 && height < 48)
printf(\); printf(\); else return 0;
if(height >= 72)
printf(\); printf(\); else
int weight, height; int years = 0; double Lucky = 1e6; while(Lucky > 0) { }
printf(\,years); return 0;
years++;
Lucky = Lucky+ Lucky*0.08 - 1e5;
5.*#%*#%$#%*#%*#%$#%*#%*#%$#%*#%*#% 6.fathatcatOh no! hatcatOh no! catOh no!
7.#include
int main(void) { }
8.重复打印:
You are 65.Here is your gold watch.
问题在于if(age = 65);应该写成if(65 == age) 9.q Step 1 Step 2 Step 3 c Step 1 g Step 1 Step 3 b Step 1 Done
10.#include
int main(void)
while((ch = getchar()) != '#') { }
printf(\,lc, uc, oc); return 0;
if(islower(ch))
lc++; uc++; oc++;
elseif(isupper(ch)) else char ch; int lc = 0; int uc = 0; int oc = 0;
{ } 编程练习
1.#include
int main(void) {
char ch; int cc = 0; int sc = 0; int nc = 0;
printf(\); while((ch = getchar()) != '#') { }
printf(\); printf(\,cc, sc, nc); printf(\); return 0;
cc++;
if(ch == ' ')
sc++; nc++;
elseif (ch == '\\n') char ch;
while((ch = getchar()) != '#') { }
printf(\); return 0;
if(ch != '\\n') { }
printf(\); if(ch == 'b') { }
break;
if(ch != 'g') printf(\); printf(\); elseif(ch != 'c')