当前位置:网站首页>[introduction to C language] zzulioj 1026-1030
[introduction to C language] zzulioj 1026-1030
2022-07-28 00:56:00 【Death margin~】
ZZULIOJ 1026: Character type judgment
Title Description
Enter a character from the keyboard , Determine whether the character is capitalized 、 Lowercase letters 、 Numeric characters or other characters . Output corresponding prompt information respectively .
Input
Enter a character .
Output
If the character is a capital letter , The output “upper”; If it's lowercase , The output “lower”; If it is a numeric character , The output “digit”; For other characters , The output “other”.( The output does not contain double quotes ).
The sample input
ESample output
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: Judge the number of daffodils
Title Description
Spring is the season of flowers , Narcissus is one of the most charming representatives , There's a narcissus number in math , He defines it like this :“ Narcissistic number ” A three digit number , The cube sum of its digits is equal to itself , such as :153=13+53+33. Now ask for a three digit number , Judge whether the number is daffodil number , If it is , Output “yes”, Otherwise output “no”
Input
Enter a positive three digit integer .
Output
Output “yes” or “no”.
The sample input
153Sample output
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 Leap year !
Title Description
According to a year , Determine if it's a leap year .
Input
Enter as an integer , Represents a year .
Output
If it's a leap year , Output "Yes", Otherwise output "No". The output is on a single line .
The sample input
2012Sample output
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: Triangle determination
Title Description
Here are three positive integers , Judge whether using these three integers as the side length can form a triangle .
Input
The input is three int The positive integer of the range , There is a space between .
Output
If you can form a triangle , Output "Yes", Otherwise output "No"
The sample input
3 4 5Sample output
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: Judge right triangle
Title Description
Enter three positive integers , Judge whether using these three integers as the side length can form a right triangle .
Input
Enter three positive integers .
Output
Whether it can form a right triangle . If you can output :yes. If not , Output :no.
The sample input
6 8 10Sample output
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;}
边栏推荐
- startUMl
- LeetCode_ Bit operation_ Medium_ 137. Number II that appears only once
- 为华为打造无美系设备的产线,台积电三星能做到吗?
- Recurrence of fastjson historical vulnerabilities
- LeetCode - 寻找两个正序数组的中位数
- 小程序助力智能家居生态平台
- 芯片行业常用英文术语最详细总结(图文快速掌握)
- What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention
- 有趣的哈夫曼树
- Ddt+yaml implementation of data driven mechanism based on unittest
猜你喜欢
随机推荐
Set 数据构造函数
Fastjson历史漏洞复现
红队大杀器 Behinder_v4.0(冰蝎4.0)
Matlab | those matlab tips you have to know (4)
R language uses ggplot2 visualization: use ggpattern package to add custom stripe patterns, shadows, stripes, or other patterns or textures to the grouped bar graph
Ddt+yaml implementation of data driven mechanism based on unittest
[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development
阿里二面:为什么要分库分表?
LeetCode_ Bit operation_ Medium_ 137. Number II that appears only once
Add a picture in front of the cell
LeetCode_位运算_中等_137.只出现一次的数字 II
网络设备硬核技术内幕 防火墙与安全网关篇 (八) 虚拟化神器 (中)
网络设备硬核技术内幕 防火墙与安全网关篇 (十)
大众中国豪掷80亿,成国轩高科第一大股东
Operators in MySQL
Matlab | those matlab tips you have to know (3)
[CruiseControl]Build Result JSP
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
一周年创作纪念日,冲吧少年郎
Build Release Blogs








