山东科技大学C语言作业四

2026/1/27 11:51:37

Time Limit: 1 Sec Memory Limit: 2 MB Submit: 1995 Solved: 913 [Submit][Status][Web Board]

Description

求三个整数的最大值。

----------------------------------------------------------------------------- 编写一个函数maxValue()求三个整数的最大值。其原型为: int maxValue(int a,int b,int c);

功能:函数的三个参数传入a,b,c的值,返回其中最大值。 函数的调用格式见“Append Code”。

Input

输入三个int类型的整数,两两之间用空格隔开。

Output

输出三个整数的最大值。

Sample Input

1 2 3

Sample Output

3

HINT

参看系统首页上的“Append Code”使用说明,讨论版(Web Board)上也有。

Append Code

append.c, append.cc, [Submit][Status][Web Board]

???< 中文 ????? English ??? All Copyright Reserved 2010-2011 SDUSTOJ TEAM GPL2.0 2003-2011 HUSTOJ Project TEAM Anything about the Problems, Please Contact Admin:admin

#include

int maxValue(int a,int b,int c) {

int x;

x=a>b?a:b; if(x

int main() {

int x,y,z;

scanf(\ printf(\ return 0; }

正确:#include int maxValue(int a,int b,int c) {

if(a>b&&b>c) return a;

else if(b>a&&b>c) return b;

else if(c>a&&c>b) return c; }

Time Limit: 1 Sec Memory Limit: 2 MB Submit: 1064 Solved: 448 [Submit][Status][Web Board]

Description

判断给定的一个字符是否是元音字母(a,e,i,o,u)?

----------------------------------------------------------------------------- 用C语言实现:append.c中函数原型为 int is_vocals(char c);

功能:若c是元音字母返回1,否则返回0。 用C++实现:append.cc中函数原型为 bool isVocals(char c);

功能:若c是元音字母返回true,否则返回false。 函数的调用格式见“Append Code”。

Input

输入一个字母。

Output

如果是一个元音字母,则输出: It is a vocals. 否则输出: It is not a vocals.

Sample Input

a

Sample Output

It is a vocals.

HINT

参看系统首页上的“Append Code”使用说明,讨论版(Web Board)上也有。

Append Code

append.c, append.cc, [Submit][Status][Web Board]

???< 中文 ????? English ??? All Copyright Reserved 2010-2011 SDUSTOJ TEAM GPL2.0 2003-2011 HUSTOJ Project TEAM Anything about the Problems, Please Contact Admin:admin

#include int is_vocals(char c) {

if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U') return 1; else

return 0; }

Problem K: 编写函数:是否水仙花数? (Append

Code)

Time Limit: 1 Sec Memory Limit: 2 MB #include

int main()

{

int x,a,b,c;

Submit: 1219 Solved: 337 scanf (\

a=x;

b=x/10;

c=x/100;

if(a*a*a+b*b*b+c*c*c==x)


山东科技大学C语言作业四.doc 将本文的Word文档下载到电脑
搜索更多关于: 山东科技大学C语言作业四 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219