Program to generate Tsunami report

Select Articles

Program to generate Tsunami report

Program to generate Tsunami report 

Program to generate Tsunami report is discussed here.

 

Problem Description

In Japan, there was a very huge Tsunami. Millions and millions worth buildings and properties were destroyed. Many people lost their lives. Most of them were injured and few were safe. A news reporter arrives at the spot to take the current survey regarding the situation of the people alive, dead and injured. He wanted to publish it in the newspaper and ask the other countries to help the affected people.

Can you please help him in this noble cause by writing a program to generate the newspaper report?

 

INPUT FORMAT:

Input consists of three integers corresponding to the number of people dead, injured and those who are still alive and safe.

 

OUTPUT FORMAT:

Refer sample input and output for formatting specifications.

[All text in bold corresponds to the input and the rest corresponds to output]
 

SAMPLE INPUT AND OUTPUT FORMAT:

2000

3000

10000

 

1)Dead : 2000

2)Injured : 3000

3)Safe : 10000

Please help the people who are suffering!!!

 

Program to generate Tsunami report

C

// C program to generate tsunami report

#include

int main()

{

//fill the code

int dead, injured, safe;

scanf(“%d%d%d”, &dead, &injured, &safe);

printf(“1)Dead : %d\n2)Injured : %d\n3)Safe : %d”,dead, injured, safe);

printf(“\nPlease help the people who are suffering!!!”);

return 0;

}

 

C++

// C++ program to generate tsunami report

#include

using namespace std;

int main()

{

//fill the code

int dead, injured, safe;

cin >> dead >> injured >> safe;

cout <<“1)Dead : ” << dead>

cout << “\nPlease help the people who are suffering!!!”;

return 0;

}

 

JAVA 8 

// Java program to generate tsunami report

import java.util.*;

public class Main

{

public static void main(String[] args)

    {

    int dead, injured, safe;

    Scanner sc = new Scanner(System.in);

    dead = sc.nextInt();

    injured = sc.nextInt();

    safe = sc.nextInt();

    System.out.print(“1)Dead : ” + dead + “\n2)Injured : ” + injured + “\n3)Safe : ” + safe);

    System.out.print(“\nPlease help the people who are suffering!!!”);

    }

}

 

PYTHON 3

# Python program to generate tsunami report

dead = int(input())

injured = int(input())

safe = int(input())

print(“1)Dead :”, dead,”\n2)Injured :”, injured,”\n3)Safe :” ,safe);

print(“Please help the people who are suffering!!!”)

 

OUTPUT

2000

3000

10000

 

1)Dead : 2000

2)Injured : 3000

3)Safe : 10000

Please help the people who are suffering!!!