java 第一 二章作业,第二章课后作业

第一题

#include

int main()

{

printf("郭钧益\n");

printf("郭\n钧益\n");

printf("郭 ");

printf("钧益\n");

return 0;

}

a4e6d87cd66f61bd1b21116fac7a79de.png

第二题

#include

#include

int main()

{

printf("姓名:gjy\n");

printf("地址:jiaxing");

return 0;

}

ec44f09dc04470a16771560f6f9f20a6.png

第三题

#include

#define Y 365

int main()

{

int age, days;

printf("输入你的年龄:");

scanf_s("%d", &age);

days = age *Y ;

printf("You age is %d,and It is %d days.\n", age, days);

return 0;

}

798cf19505521cebca1a4bdc775a2144.png

第四题

#include

int jolly();

int deny();

int main() {

jolly();

jolly();

jolly();

deny();

return 0;

}

int jolly() {

printf("For he's a jolly good fellow!\n");

return 0;

}

int deny() {

printf("Which nobody can deny!\n");

return 0;

}

48dae0e7405ee52c348921c5eb110d3f.png

第五题

#include

int br();

int ic();

int main() {

br();

printf(",");

ic();

printf("\n");

ic();

printf("\n");

br();

printf("\n");

return 0;

}

int br() {

printf("Btazil.Russia");

return 0;

}

int ic() {

printf("India.China");

return 0;

}

136fe844e0808a70b872881f685073c8.png

第六题

#include

int main() {

int toes;

toes= 10;

printf("The Variable toes = %d.\n", toes);

printf("double toes = %d.\n", 2 * toes);

printf("toes' square = %d.\n", toes * toes);

return 0;

}

b14ab1f35c0807718595b3dfc06ef731.png

第七题

int smile(void);

#include

int main() {

smile();smile();smile();

printf("\n");

smile();smile();

printf("\n");

smile();

return 0;

}

int smile() {

printf("Smile!");

return 0;

}

3492c618cf70e58f9a67575ac98857ad.png

第八题

int smile();

#include

int one_three();

int two();

int main() {

printf("Starting now:\n");

one_three();

printf("Done!\n");

return 0;

}

int one_three() {

printf("one\n");

two();

printf("three\n");

return 0;

}

int two() {

printf("two\n");

return 0;

}

790d188509d13b146c92b7104adb68d2.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值