当前位置:网站首页>Introduction to C language (6)
Introduction to C language (6)
2022-07-18 07:08:00 【InfoQ】
1. Character type judgment
Eupper#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");
else
printf("other\n");
return 0;
}2. Judge the number of daffodils
153yes#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;
}3.I love Leap year !
2012Yes#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;
}4. Triangle determination
3 4 5Yes#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");
}else
printf("No");
return 0;
}5. Judge right triangle
6 8 10yes#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");
}else
printf("no");
return 0;
}边栏推荐
- C language Chapter 9 string
- The characteristics and underlying principles of synchronized, as well as the state and expansion and upgrading process of locks
- linq 实现查询字符串拼接 : And 和 OR 两种方式
- Linked list implementation of C language stack
- Chapter 6 functions of C language
- Processing and analysis of yolov3 training data
- Chapter 7 preprocessing of C language
- LeeCode机器人的运动范围
- Ten optimization rules of Clickhouse SQL
- C 语言入门(六)
猜你喜欢

Excel import / export annotation General Edition

Business development stagnates, decision-making is not supported by information, and data analysis is the solution

9. MySQL -- JDBC入门

Chapter 7 preprocessing of C language

自增(自减)运算符的运算优先级

带图像识别的YYS连点器 V2.0

Thumbnailator 图片处理类库

The more you sell, the less you earn? Financial analysis thinking of profit growth rate lower than sales growth rate

Pass value, reference and pointer

【示波器的基本使用】以及【示波器按键面板上各个按键含义的介绍】
随机推荐
Insert any element at the specified position in the array and delete the element with value x in the array
复杂链表的复制
The IP address of the database is stored. What data type is used
初学者怎么快速学会SQL
日志的管理
Array and string assignment problem (not initialized when defining)
Switching with file system in OTA upgrade
Redis installation & startup
MySQL autoincrement, index, foreign key, other operations
7. MySQL -- 基础语法(三) DCL
什么是进制?
MySQL触发器
9. MySQL -- JDBC入门
Excel import / export annotation General Edition
示波器使用概念记录
Ffmpeg sample analysis: muting c
C language Chapter 9 string
TP5 分页一些小点
Enumeration, do you know it?
C语言:使用宏重定义printf,打印【debug调试信息】