当前位置:网站首页>【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;}
边栏推荐
- 阿里二面:为什么要分库分表?
- [meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
- 递归求解迷宫问题
- mysql分表之后怎么平滑上线?
- How does JMeter solve the problem of garbled code?
- startUMl
- Jmeter 如何解决乱码问题?
- Leetcode 452. minimum number of arrows to burst balloons (medium)
- mysql数据库的基本操作(二)-——基于数据表
- Matlab | matlab terrain generation: rectangular iteration method, inverse Fourier transform method, fractal Berlin noise method
猜你喜欢
![[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development](/img/17/15c759aadafc335028d37380903ee7.jpg)
[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development

激活最大化

Matlab | those matlab tips you have to know (2)
![[leetcode] 547. Number of provinces (medium)](/img/15/d49d18151c47e318fe7acabdd616e6.png)
[leetcode] 547. Number of provinces (medium)

IP address & subnet mask

芯片行业常用英文术语最详细总结(图文快速掌握)

Point divide and conquer analysis

Postman download and use tutorial

一周年创作纪念日,冲吧少年郎
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP
随机推荐
What are the namespaces and function overloads of + and @ in front of MATLAB folder
Code review tool
Ali Er Mian: why do we need to separate databases and tables?
LED, nixie tube and key of single chip microcomputer
Jerry caused other messages to accumulate in the message pool [article]
LeetCode 415. 字符串相加 和 43. 字符串相乘
Valued at $36billion! SpaceX, which is about to launch its first manned launch, raised $346million
R language evaluates the relative importance of the predictive factors (variables, characteristics) of the regression model, scales the predictive variables of the regression model, and then construct
MySQL中的运算符
Network device hard core technology insider firewall and security gateway (10)
[leetcode] 547. Number of provinces (medium)
Fastjson历史漏洞复现
函数相关知识
Network equipment hard core technology insider firewall and security gateway chapter (VI) security double repair under the law
Jmeter 如何解决乱码问题?
mysql分表之后怎么平滑上线?
网络设备硬核技术内幕 防火墙与安全网关篇 (六) 安全双修大法 下
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
Redis-三大特殊数据类型的学习和理解
Focus on demand flow rather than idle people