浙大版C语言题目集2-1

2-1-1

本题要求编写程序,输出一个短句“Welcome to You!”。

输入格式:

本题目没有输入。

输出格式:

在一行中输出短句“Welcome to You!”。

#include <stdio.h> 

int main()
{
	printf("Welcome to You"); 
	return 0;
}

2-1-2

本题要求编写程序,输出一个短句“Programming in C is fun!”。

输入格式:

本题目没有输入。

输出格式:

在一行中输出短句“Programming in C is fun!”。

#include <stdio.h> 

int main()
{
	printf("Programming in C is fun!"); 
	return 0;
}

2-1-3

本题要求编写程序,输出指定的由“*”组成的三角图案。

输入格式:

本题无输入

输出格式:

按照下列格式输出由“*”组成的三角图案。

#include <stdio.h> 

int main()
{
	printf("****\n"); 
	printf("***\n"); 
	printf("**\n"); 
	printf("*\n"); 
	return 0;
}

2-1-4

本题要求编写程序,输出指定的由“A”组成的菱形图案。

输入格式:

本题无输入

输出格式:

按照下列格式输出由“A”组成的菱形图案。

#include <stdio.h> 

int main()
{
	printf(" A \n"); 
	printf("A A\n"); 
	printf(" A "); 
	return 0;
}

2-1-5

本题要求编写程序,输出指定的带框文字。

输入格式:

本题无输入

输出格式:

按照下列格式输出带框文字。

#include <stdio.h> 

int main()
{
	printf("************\n"); 
	printf("  Welcome  \n"); 
	printf("************"); 
	return 0;
}

2-1-6

本题要求编写程序,在屏幕上打印5行菜单。

输入格式:

本题目没有输入。

输出格式:

按照下列格式打印菜单,每行显示一句。注意除了每行的换行不能有任何多余字符。

[1] Select crisps

[2] Select popcorn

[3] Select chocolate

[4] Select cola

[0] Exit

#include <stdio.h> 

int main()
{
	printf("[1] Select crisps\n"); 
	printf("[2] Select popcorn\n"); 
	printf("[3] Select chocolate\n"); 
	printf("[4] Select cola\n"); 
	printf("[0] Exit"); 
	return 0;
}

2-1-7

本题要求编写程序,输出指定的由“*”组成的倒三角图案。

输入格式:

本题目没有输入。

输出格式:

按照下列格式输出由“*”组成的倒三角图案。

* * * *
 * * *
  * *
   *
#include <stdio.h> 

int main()
{
	printf("* * * *\n"); 
	printf(" * * * \n"); 
	printf("  * *  \n"); 
	printf("   *   \n"); 
	return 0;
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值