当前位置:网站首页>【C语言入门】ZZULIOJ 1021-1025
【C语言入门】ZZULIOJ 1021-1025
2022-07-27 12:52:00 【逝缘~】
ZZULIOJ 1021:三个整数的最大值
题目描述
从键盘输入三个整数 x,y 和 z,求出其中最大的数。
输入
输入三个整数,用空格隔开。
输出
输出最大整数。
样例输入
20 16 18样例输出
20#include <stdio.h>#include <stdlib.h>int main(){ int x,y,z,m,max;scanf("%d %d %d",&x,&y,&z);if(x<y){m=y;}else{m=x;}if(m<z){max= z;}else{max=m;}printf("%d",max);return 0;}
ZZULIOJ 1022:三整数排序
题目描述
从键盘输入三个整数 x,y 和 z,按从大到小的顺序输出它们的值。
输入
输入三个整数 x,y 和 z。
输出
按从大到小的顺序输出它们的值。
样例输入
20 16 18样例输出
20 18 16#include <stdio.h>#include <stdlib.h>int main(){ int x,y,z,m;scanf("%d %d %d",&x,&y,&z);if(x<y){m=x,x=y,y=m;}if(x<z){m=x,x=z,z=m;}if(y<z){m=y,y=z,z=m;}printf("%d %d %d",x,y,z);return 0;}
ZZULIOJ 1023:大小写转换
题目描述
输入一个字母,若是小写字母,则变为大写输出,否则,原样输出。
输入
输入为一个字符。
输出
按题目要求输出一个字符,单独占一行。
样例输入
a样例输出
A#include<stdio.h>int main(){char ch;ch = getchar();if(ch >= 'a' && ch <= 'z')ch -= 32;printf("%c\n", ch);return 0;}
ZZULIOJ 1024:计算字母序号
题目描述
输入一个英文字母(可能是大写,也可能是小写),输出该字母在字母表中的序号(’a’和’A’的序号为 1)。
输入
输入只有一个英文字母。
输出
输出一个整数,表示该字母在字母表的序号,输出单独占一行。
样例输入
D样例输出
4#include <stdio.h>#include <ctype.h>int main(){char ch;int i;ch=getchar();ch=tolower(ch);//转化为小写字母i=ch-'a'+1;printf("%d\n",i);return 0;}
ZZULIOJ 1025:最大字符
题目描述
给你三个 ASCII 字符(不含空白字符:包括空格、制表符\t、回车换行符\n),找出其中最大的那个
输入
输入包含三个字符,之间有一个空格隔开。
输出
输出 ASCII 码最大的那个字符,占一行。
样例输入
a b c样例输出
c提示
注意对输入序列中空格的处理,空格也是合法的字符
#include <stdio.h>#include <stdlib.h>int main(){char c1,c2,c3,max;scanf("%c%c%c",&c1,&c2,&c3);max=c1;if(c2>max)max=c2;if(c3>max)max=c3;printf("%c\n",max);return 0;}
边栏推荐
- Amd adrenalin 22.7.1 driver update: double the performance of OpenGL and support Microsoft win11 22h2 system
- 相对定位
- Unapp prevents continuous click errors
- How to debug JNI program
- Gan: generate adversarial networks
- eBPF/Ftrace
- 如何调试JNI程序
- v-text
- 图标字体
- Li Kou 1480. Dynamic sum of one-dimensional array 383. Ransom letter 412. Fizz buzz
猜你喜欢

Have you understood these 30 questions of enabling financial risk control plus points

字节跳动 AI Lab 总监李航:语言模型的过去、现在和未来

A survey of video game addictive behavior research

基于frp实现内网穿透——借助公网服务器实现ssh远程连接内网服务器

Interview site: three kinds of questions

Multi activity disaster recovery construction after 713 failure of station B | takintalks share

责任链模式在转转精准估价中的应用

Gan: generate adversarial networks

V-on basic instruction

v-text
随机推荐
How to pass parameters in JNI program
592. Fraction addition and subtraction: introduction to expression calculation
SCI thesis writing
Interface testing practical tutorial 01: interface testing environment construction
Perfect guide | how to use ODBC for agent free Oracle database monitoring?
52:第五章:开发admin管理服务:5:开发【分页查询admin账号列表,接口】;(Swagger的@ApiParam(),对方法参数进行注释;PageHelper分页插件;拦截器拦截检查登录状态)
Feign's dynamic proxy
Final solution for high collapse (no side effects)
接口测试实战教程01:接口测试环境搭建
使用碳刷的注意事项有哪些
Calculates the length of the last word of the string, separated by spaces.
eBPF/Ftrace
Write a program, accept a string consisting of letters, numbers and spaces, and a character, and then output the number of characters in the input string. Case insensitive.
Musk was exposed to be the founder of Google: he broke up his best friend's second marriage and knelt down to beg for forgiveness
元素的层级
Common types of electric slip rings
Icon Font
js基础知识整理之 —— 数组
Wfuzz, a test tool that can blur everything that can be blurred
计算字符串最后一个单词的长度,单词以空格隔开。