当前位置:网站首页>[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;}
边栏推荐
- Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]
- Read cmake in one article
- 2020年一季度可穿戴市场出货量达7260万部,苹果独占近三成市场份额
- map集合
- Leetcode 415. string addition and 43. string multiplication
- 至少42名员工感染新冠病毒!诺基亚宣布关闭印度电信设备工厂
- Jerry Zhi has problems in real-time adjustment of sound change effect in magic sound mode [chapter]
- What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention
- IP address & subnet mask
- Data visualization - White Snake 2: black snake robbery (3)
猜你喜欢
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP

How does JMeter solve the problem of garbled code?

点分治解析

融云 IM & RTC 能力上新盘点

Build Release Blogs

Confused SCM matrix keys

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

Resolved Unicode decodeerror: 'UTF-8' codec can't decode byte 0xa1 in position 0: invalid start byte

Matlab | those matlab tips you have to know (4)

How does matlab set the K-line diagram to classic red and green color matching?
随机推荐
592. 分数加减运算 : 表达式计算入门题
Logic of automatic reasoning 09 - automatic theorem proving
Resolved Unicode decodeerror: 'UTF-8' codec can't decode byte 0xa1 in position 0: invalid start byte
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
Jerry's PWM setting and PWM IO selection [chapter]
MySQL limit usage and large paging problem solving
"C language" deep entry rounding & four functions
Recurrence of fastjson historical vulnerabilities
Network equipment hard core technology insider firewall and security gateway (11) secrets of zero contact office
[must read for new products] valuation analysis of Meishi technology, distributed audio-visual products and Solutions
[BuildRelease Management]Parabuild
估值360亿美元!即将进行首次载人发射的SpaceX筹资3.46亿美元
Red team killer behinder_ V4.0 (ice scorpion 4.0)
一周年创作纪念日,冲吧少年郎
Network equipment hard core technology insider firewall and security gateway (V) security double repair method
Arm发布全新A78/G78/N78内核!还有支持自定义的Cortex-X系列CPU
Leetcode:1997. the first day after visiting all rooms [jump DP]
Redis-事务与乐观锁
Read cmake in one article
大众中国豪掷80亿,成国轩高科第一大股东