URI-1008 Solve

Salary

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Write a program that reads an employee's number, his/her worked hours number in a month and the amount he received per hour. Print the employee's number and salary that he/she will receive at end of the month, with two decimal places.
  • Don’t forget to print the line's end after the result, otherwise you will receive “Presentation Error”.
  • Don’t forget the space before and after the equal signal and after the U$.

Input

The input file contains 2 integer numbers and 1 value of floating point, representing the number, worked hours amount and the amount the employee receives per worked hour.

Output

Print the number and the employee's salary, according to the given example, with a blank space before and after the equal signal.
Input SamplesOutput Samples
25
100
5.50
NUMBER = 25
SALARY = U$ 550.00
1
200
20.50
NUMBER = 1
SALARY = U$ 4100.00
6
145
15.55
NUMBER = 6
SALARY = U$ 2254.75
Problem link: https://www.urionlinejudge.com.br/judge/en/problems/view/1008

Solution:

  • [tab]
    • C
      • #include<stdio.h>
        int main(void){
            int a,member;
            double amount,salary;
            while(scanf("%d%d%lf",&a,&member,&amount)==3){
                salary=(double)member*amount;
                printf("NUMBER = %d\nSALARY = U$ %.2lf\n",a,salary);
            }
            return 0;
        }
    • C++
      • #include <cstdio>
        
        int main()
        {
         int a;
         int b;
         float c;
        
         scanf("%d", &a);
         scanf("%d", &b);
         scanf("%f", &c);
        
         printf("NUMBER = %d\n", a);
         printf("SALARY = U$ %.2f\n", b * c);
        
         return 0;
        }
3/Technology/post-list
Name

Codeforces,53,Problem Solve,90,Programming Tricks,1,URI,37,
ltr
item
DorHubs: URI-1008 Solve
URI-1008 Solve
https://resources.urionlinejudge.com.br/gallery/images/flags/br.gif
DorHubs
https://dorhubs.blogspot.com/2019/08/uri-1008-solve.html
https://dorhubs.blogspot.com/
https://dorhubs.blogspot.com/
https://dorhubs.blogspot.com/2019/08/uri-1008-solve.html
true
9087637800571592252
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy