当前位置:首页 > 山东科技大学C语言作业四
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 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 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)
共分享92篇相关文档