C Primer Plus 编程练习 第二章

2021/9/22 11:39:49

本文主要是介绍C Primer Plus 编程练习 第二章,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

#include<stdio.h>
int main(void)
{
	printf("Gustav Mahler\n");
	printf("Gustav\n");
	printf("Mahler\n");
	printf("Gustav Mahler");
	getchar();
	return 0;
}
#include<stdio.h>
int main(void)
{
	printf("我的姓名是:XX,我的地址是:XXXXXXXXXXXXXXX");
	getchar();
	return 0;
}
#include<stdio.h>
int main(void)
{
	int age, days;
	printf("请输入年龄:");
	scanf("%d", &age);
	days = age * 365;
	printf("%d岁对应的天数是:%d", age, days);
	getchar();
	getchar();
	return 0;
}
#include<stdio.h>
void jolly();
void deny();
int main(void)
{
	jolly();
	jolly();
	jolly();
	deny();
	getchar();
	return 0;
}
void jolly()
{
	printf("For he's a jolly good fellow!\n");
}
void deny()
{
	printf("Which nobody can deny!\n");
}
#include<stdio.h>
void br();
void ic();
int main(void)
{
	br();
	printf(",");
	ic();
	printf("\n");
	ic();
	printf(",\n");
	br();
	getchar();
	return 0;
}
void br()
{
	printf("Brazil, Russia");
}
void ic()
{
	printf("India, China");
}
#include<stdio.h>
int main(void)
{
	int toes;
	int square, cube;
	toes = 10;
	square = toes*toes;
	cube = toes*toes*toes;
	printf("%d的平方是:%d,立方是:%d", toes, square, cube);
	getchar();
	return 0;
}
#include<stdio.h>
void smile();
int main(void)
{
	smile();
	smile();
	smile();
	printf("\n");
	smile();
	smile();
	printf("\n");
	smile();
	getchar();
	return 0;
}
void smile()
{
	printf("Smile!");
}
#include<stdio.h>
void one_three();
void two();
int main(void)
{
	printf("starting now:\n");
	one_three();
	printf("done!");
	getchar();
	return 0;
}
void one_three()
{
	printf("one\n");
	two();
	printf("three\n");

}
void two()
{
	printf("two\n");
}


这篇关于C Primer Plus 编程练习 第二章的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程