1 solutions
-
0
C :
#include<stdio.h> int main() { double x,y; scanf("%lf",&x); if(x<1) y=x; else if(x>=1&&x<10) y=2*x-1; else y=3*x-11; printf("%.2f",y); return 0; }C++ :
#include<iostream> using namespace std; int main() { int x; cin >> x; if(x < 1){ printf("%.2f", (float)x); }else if(x < 10){ printf("%.2f", 2.0 * x - 1); }else { printf("%.2f", 3.0 * x - 11); } return 0; }
- 1
Information
- ID
- 17583
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By