当前位置:网站首页>[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;}
边栏推荐
- Leetcode 415. string addition and 43. string multiplication
- Can TSMC Samsung build a production line without American equipment for Huawei?
- startUMl
- 递归求解迷宫问题
- 单片机之led、数码管与按键
- Programmer growth Chapter 30: do you really understand feedback?
- 【Meetup预告】OpenMLDB+OneFlow:链接特征工程到模型训练,加速机器学习模型开发
- startUMl
- LSB steganography
- 网络设备硬核技术内幕 防火墙与安全网关篇 (小结)
猜你喜欢

Basic operations of MySQL database (I) --- Based on Database

mysql数据库的基本操作(一)-——基于数据库
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP

小波变换学习笔记

Set data constructor

DC motor winding parameters

Read cmake in one article

What is the org relationship mitigation strategy of Microsoft edge browser tracking prevention

Recurrence of fastjson historical vulnerabilities

Confused SCM matrix keys
随机推荐
Recurrence of fastjson historical vulnerabilities
网络设备硬核技术内幕 防火墙与安全网关篇 (七) 虚拟化神器 (上)
"C language" deep entry rounding & four functions
数据分析:拆解方法(详情整理)
Redis transaction and optimistic lock
小波变换学习笔记
网络设备硬核技术内幕 防火墙与安全网关篇 (五) 安全双修大法 中
c# 反射之Type使用
LED, nixie tube and key of single chip microcomputer
红队大杀器 Behinder_v4.0(冰蝎4.0)
网络设备硬核技术内幕 防火墙与安全网关篇 (九) 虚拟化神器 (下)
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
ASML推出第一代HMI多光束检测机:速度提升600%,适用于5nm及更先进工艺
MySQL limit usage and large paging problem solving
Focus on demand flow rather than idle people
Ddt+yaml implementation of data driven mechanism based on unittest
[leetcode] 547. Number of provinces (medium)
Rongyun IM & RTC capabilities on new sites
Network device hard core technology insider firewall and security gateway (VIII) virtualization artifact (middle)
Point divide and conquer analysis