C Primer Plus 第6版 编程练习 2.12 答案

1# 2#
#include<stdio.h>
int main(void)
{
printf("胡八一\n");
printf("胡\n八一\n");
printf("姓名:胡八一\n");
printf("地址:山东省青岛市\n");
system("pause");
return 0;
}
3#
#include<stdio.h>
int main(void)
{
int a = 25;//a代表年龄
int b = 365;//b代表一年天数
printf("%d\n", a*b);
system("pause");
return 0;
}
4#
#include<stdio.h>
void jolly(void)
{
printf("For he's a jolly good fellow!\n");
}
void deny(void)
{
printf("Which nobody can deny!\n");
}
int main(void)
{
jolly();
jolly();
jolly();
deny();
system("pause");
return 0;
}
5#
#include<stdio.h>
void br(void)
{
printf("Brazil,Russia");
}
void ic(void)
{
printf("India,China\n");
}
int main(void)
{
br(),   ic();
ic();
br();
system("pause");
return 0;
}
6#
#include<stdio.h>
int main(void)
{
int toes;
int a, b;
toes = 10;
a = toes * 2;
b = toes * toes;
printf("%d(toes)\n%d(toes的两倍)\n%d(toes的平方)\n",toes,a,b);
system("pause");
return 0;
}
7#
#include<stdio.h>
void a(void)
{
printf("Smile!");
}
int main(void)
{
a(); a(); a();


printf("\n");


a(); a();


printf("\n");
a();


    system("pause");
return 0;


}
8#
#include<stdio.h>
int one_three(void);
int two(void);
int one_three(void)
{
printf("one\n");
}
int two(void)
{
printf("two\nthree\n");
}
int main(void)
{
printf("starting now :\n");
one_three();
two();
printf("down!\n");
system("pause");
return 0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值