当前位置:网站首页>【C语言入门】ZZULIOJ 1026-1030
【C语言入门】ZZULIOJ 1026-1030
2022-07-27 22:13:00 【逝缘~】
ZZULIOJ 1026:字符类型判断
题目描述
从键盘输入一个字符,判断该字符是否大写字母、小写字母、数字字符或其他字符。分别输出对应的提示信息。
输入
输入一个字符。
输出
如果该字符是大写字母,则输出“upper”;若是小写字母,则输出“lower”;若是数字字符,则输出“digit”;若是其他字符,则输出“other”。(输出不含双引号)。
样例输入
E样例输出
upper#include<stdio.h>#include<ctype.h>int main(){char ch;scanf("%c",&ch);if(islower(ch))printf("lower\n");else if(isupper(ch))printf("upper\n");else if(isdigit(ch))printf("digit\n");elseprintf("other\n");return 0;}
ZZULIOJ 1027:判断水仙花数
题目描述
春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的:“水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=13+53+33。 现在要求输入一个三位数,判断该数是否是水仙花数,如果是,输出“yes”,否则输出“no”
输入
输入一个三位的正整数。
输出
输出“yes”或“no”。
样例输入
153样例输出
yes#include <stdio.h>#include <stdlib.h>int main(){ int m,a,b,c;scanf ("%d",&m);a=m/100;b=(m/10)%10;c=m%10;if(m==a*a*a+b*b*b+c*c*c){printf("yes");}else{printf("no");}return 0;}
ZZULIOJ 1028:I love 闰年!
题目描述
根据一个年份,判断是否是闰年。
输入
输入为一个整数,表示一个年份。
输出
如果是闰年,输出"Yes",否则输出"No"。输出单独占一行。
样例输入
2012样例输出
Yes#include <stdio.h>#include <stdlib.h>int main(){int y;scanf("%d",&y);if(y%400==0||(y%4==0&&y%100!=0)){printf("Yes\n");}else{printf("No\n");}return 0;}
ZZULIOJ 1029:三角形判定
题目描述
给你三个正整数,判断用这三个整数做边长是否能构成一个三角形。
输入
输入为三个 int 范围的正整数,中间有一个空格隔开。
输出
如果能构成三角形,输出"Yes",否则输出"No"
样例输入
3 4 5样例输出
Yes#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){int a,b,c;scanf("%d %d %d",&a,&b,&c);if(a+b>c&&a+c>b&&b+c>a){printf("Yes");}elseprintf("No");return 0;}
ZZULIOJ 1030:判断直角三角形
题目描述
输入三个正整数,判断用这三个整数做边长是否能构成一个直角三角形。
输入
输入三个正整数。
输出
能否构成直角三角形。如能输出:yes.若不能,输出:no。
样例输入
6 8 10样例输出
yes#include <stdio.h>#include <stdlib.h>int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){printf("yes");}elseprintf("no");return 0;}
边栏推荐
猜你喜欢

Set data constructor

蓝桥杯单片机第十一届国赛程序设计试题

《KMP复习 + AC自动机》前传

From the second floor to the third floor

Red team killer behinder_ V4.0 (ice scorpion 4.0)
![Jerry, if you turn on Bluetooth again, one for two. When the mobile phone is connected to the prototype, it will appear and cannot be connected [chapter]](/img/6c/d4a45981a7fc87f6a82a91017f8ce8.png)
Jerry, if you turn on Bluetooth again, one for two. When the mobile phone is connected to the prototype, it will appear and cannot be connected [chapter]

mysql分表之后怎么平滑上线?

The program design questions of the 11th national competition of Bluebridge cup single chip microcomputer

Postman download and use tutorial

数据分析:拆解方法(详情整理)
随机推荐
startUMl
How does matlab set the K-line diagram to classic red and green color matching?
Valued at $36billion! SpaceX, which is about to launch its first manned launch, raised $346million
点分治解析
相应通道无电压但ADC的值却在大幅变化且不等于0的可能原因
Network device hard core technology insider firewall and security gateway (10)
Volkswagen China invested 8billion yuan and became the largest shareholder of GuoXuan high tech
Rongyun IM & RTC capabilities on new sites
MySQL中的运算符
Basic elementary function
数据分析:拆解方法(详情整理)
Selection of FFT sampling frequency and sampling points
Point divide and conquer analysis
[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
Leetcode 452. minimum number of arrows to burst balloons (medium)
Basic operations of MySQL database (3) --- Based on fields
MySQL limit usage and large paging problem solving
Redis-三大特殊数据类型的学习和理解
Count the six weapons of the domestic interface cooperation platform!
Jerry Zhi doesn't play hidden audio files [article]