当前位置:网站首页>[introduction to C language] zzulioj 1031-1035
[introduction to C language] zzulioj 1031-1035
2022-07-29 03:48:00 【Death margin~】
ZZULIOJ 1031: What quadrant is the judgment point
Title Description
Input from keyboard 2 It's an integer x、y value , Represents a coordinate point on the plane , Judge which quadrant the coordinate point is in , And output the corresponding results .
Input
Input x,y Value represents a coordinate point . The coordinate point will not be in x Axis and y On the shaft , Nor at the origin .
Output
Output the corresponding quadrant , Use numbers 1,2,3,4 Corresponding to four quadrants respectively .>
The sample input
1 1Sample output
1#include <stdio.h>#include <stdlib.h>int main(){int a,b;scanf("%d %d",&a,&b);if(a>0&&b>0)printf("1");if(a<0&&b>0)printf("2");if(a<0&&b<0)printf("3");if(a>0&&b<0)printf("4");return 0;}
ZZULIOJ 1032: Staff salaries
Title Description
Regulations of a company , The salary of salesperson consists of basic salary and sales commission , The basic salary is 1500 element / month , The sales commission rules are as follows : Sales volume is less than or equal to 10000 Yuan time , according to 5% Royalty ; Sales greater than 10000 Yuan but less than or equal to 50000 Yuan time , beyond 10000 Partly according to 3% Royalty ; Sales greater than 50000 Yuan time , beyond 50000 Partly according to 2% Royalty . Programming , Calculate employee income based on sales .
Input
Enter an integer to represent sales
Output
Output employees' salaries , Retain 2 Decimal place .
The sample input
30000Sample output
2600.00#include <stdio.h>#include <stdlib.h>int main(){int a;double m;scanf("%d",&a);if(a<=10000)m=a*0.05+1500;if(a>10000&&a<=50000)m=(a-10000)*0.03+1500+500;if(a>50000)m=(a-50000)*0.02+1500+500+1200;printf("%.2lf",m);return 0;}
ZZULIOJ 1033: Five grade system
Title Description
Given a 100 point score , Please output the corresponding grade according to the hundred mark system . The transformation relationship is as follows :90 Points and above are ’A’,80~89 by ’B’, 70~79 by ’C’, 60~69 by ’D’,60 It is divided into the following ’E’.
Input
A hundred mark mark (0~100 The integer of ).
Output
Output corresponding level .
The sample input
100
Sample output
A#include <stdio.h>#include <stdlib.h>int main(){int m;scanf("%d",&m);if(m>=90)printf("A");if(m>79&&m<90)printf("B");if(m>69&&m<80)printf("C");if(m>59&&m<70)printf("D");if(m<60)printf("E");return 0;}
ZZULIOJ 1034: Summer sales
Title Description
Shopping mall summer promotion , shopping 500 Yuan of the following , No discount ; shopping 500 element ( contain ) above ,95 fold ; shopping 1000 element ( contain ) above ,9 fold ; shopping 3000 element ( contain ) above ,85 fold ; shopping 5000 element ( contain ) above ,8 fold . According to the consumption amount , Determine the amount that the user actually needs to pay .
Input
Enter a real number , Indicates the consumption amount .
Output
Output a real number , It indicates the actual amount that the user needs to spend , Keep two decimal places .
The sample input
5100 Sample output
4080.00#include <stdio.h>#include <stdlib.h>int main(){int m;double n;scanf("%d",&m);if(m>=5000)n=0.8*m;if(m>=1000&&m<3000)n=0.9*m;if(m>=500&&m<1000)n=0.95*m;if(m<500)n=m;if(m>=3000&&m<5000)n=0.85*m;printf("%.2f",n);return 0;}
ZZULIOJ 1035: Piecewise function evaluation
Title Description
It is known that :y yes x Function of , When x<-2 when ,y=7-2x; When x>=-2, And x<3 when ,y=5-|3x+2|; When x>=3 when ,y=3x+4
Input
Enter any integer x.
Output
The output is an integer , namely x The corresponding function value .
The sample input
2Sample output
-3#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){int x,y;scanf("%d",&x);if(x<-2)y=7-2*x;if(x>=-2&&x<3)y=5-fabs(3*x+2);if(x>=3)y=3*x+4;printf("%d",y);return 0;}
边栏推荐
- The data type of symbol, a new feature of ES6
- About the writing of ALV format control part
- MOS tube - rapid recovery application notes (II) [parameters and applications]
- (2022 Hangdian multi school III) 1002 boss rush (pressure dp+ dichotomy)
- Install the packet capturing certificate
- 容斥原理
- RHCE的at,crontab的基本操作,chrony服务和对称加密和非对称加密
- The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!
- Interview essential! TCP classic 15 consecutive questions!
- Process tracking of ribbon principle
猜你喜欢

Lvs+keepalived high availability deployment practical application

Vs code must know and know 20 shortcut keys!

3.解决Pycharm报错Unresolved reference ‘selenium‘ Unresolved reference ‘webdriver‘

Shutter start white screen

Ribbon principle analysis namedcontextfactory

Interview essential! TCP classic 15 consecutive questions!

(codeforce547) c-mike and foam

Typescript from getting started to mastering (XXII) namespace namespace (I)

Getting started with caspin

向日葵资深产品总监技术分享:“国民远控”如何在AD域环境下应用
随机推荐
Interview essential! TCP classic 15 consecutive questions!
Malloc C language
"The programming is not standardized, and my colleagues are in tears!"
LVS+KeepAlived高可用部署实战应用
SQL窗口函数
Ribbon principle analysis namedcontextfactory
Typescript from entry to mastery (XVIII) joint type and type protection
(codeforce547) c-mike and foam
Shutter start white screen
Inclusion exclusion principle
Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
力扣每日一题-第44天-205. 同构字符串
Typescript from entry to mastery (XXI) generic types in classes
OPENSQL快速学习
Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP
无法一次粘贴多张图片
《陌路曾相逢》夏陌沈疏晏_夏陌沈疏晏最新章节
深入C语言(3)—— C的输入输出流
In depth C language (4) -- definition and use of switch
EMD empirical mode decomposition