Welcome

>>>Welcome to my "CODE BAZAR"
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others
Code marshal
URI online judge
Others

Update ✔✔✔ Upcoming programming book (.pdf) "Programming Contest (data structures and algorithms) by Md. Mahbub Hasan & "Graph Algorithms" by Safayat Asraf "****** Date: 20 March, 2019****Hazrat Ali****

Sunday 30 October 2016

C. Input to Output Once Again
Problem link
https://algo.codemarshal.org/contests/diu-122-fl16-termwork/problems/C


Score: 1

CPU: 1s
Memory: 512MB

Bored with the last problem? You need not worry. To spice things up we are giving you different types of inputs this time - two integers, a double, and a character. Think you can handle them all?

Input

There will be 3 lines of input:
  • The first line will contain two integers separated by a single space.
  • The second line will contain a number with decimal points.
  • The final line will contain a single character.

Output

Like the previous problem, just print the inputs exactly the way you read them.
  • First line of the output will contain the two integers. Print a single space between them. There should not be any leading or training spaces.
  • In the second line print the decimal number, two digits after decimal point.
  • Finally print the character in the 3rd line.

Sample

InputOutput
3 5 3.1415926 P3 5 3.14 P

Solutin

#include<stdio.h>
int main()
{
    int a,b;
    double i;
    char ch;
    scanf("%d%d",&a,&b);
    scanf("%lf",&i);
    getchar();
    ch=getchar();
    printf("%d %d\n%.2lf\n%c\n",a,b,i,ch);
    return 0;
}

No comments:

Post a Comment