cpp第二章编程练习

//test 1.c
#include<stdio.h>
int main(void)
{
	printf("小明\n");
	printf("小\n明\n");
	printf("小");
	printf("明\n");
}
//test3.c
#include<stdio.h>
int main(void)
{
          printf("小明,家住xx");
          return 0;
}
//test3.c
#include<stdio.h>
int main(void)
{
	int age,day;
	age=21;
	day=age*365;
	printf("年龄为%d,天数为%d\n",age,day);
	return 0;
}
//test4.c
#include<stdio.h>
void a(void);				//声明a函数
void b(void);				//声明b函数
int main(void)
{
	printf("For he's a jooly good fellow!\n");
	a();
	b();
	return 0;
}
void a(void)
{
	printf("For he's a jooly good fellow!\n");
} 
void b(void)
{
	printf("Which nobody can deny!\n");
}
//test5.c
#include<stdio.h>
int main(void)
{
	int toes=10,sum_toes,toes2;
	sum_toes=toes+toes;
	toes2=toes*toes;
	printf("toes为%d,和为%d,平方为%d\n",toes,sum_toes,toes2);
	return 0;
}
//test6.<pre name="code" class="csharp">//test7.c输出one two three
#include<stdio.h>
void one(void);
void two(void);
int main(void)
{
	printf("starting now:\n");
	one();
	two();
	printf("three\n");
	printf("done!\n");
	return 0;
}
void one()
{
	printf("one\n");
}
void two()
{
	printf("two\n");
}

c

#include<stdio.h>
void a(void);
int main(void)
{
	a();
	a();
	a();
	printf("\n");
	a();
	a();
	printf("\n");
	a();
	printf("\n");
}
void a(void)
{
	printf("Smile!");
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值