Thursday, September 13, 2018

TSUNAMI INDONESIA

  • Problem Description

    In Indonesia ,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 to 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 C 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
  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int a,b,c;
      scanf("%d%d%d",&a,&b,&c);
      printf("TSUNAMI REPORT");
      printf("\nThe number of people");
      printf("\nDead=%d",a);
      printf("\nInjured=%d",b);
      printf("\nSafe=%d",c);
      return 0;
    }
  • Test Case 1

    Input (stdin)
    2000
    
    3000
    
    10000
    
    
    Expected Output
    TSUNAMI REPORT
    
    The number of people
    
    Dead=2000
    
    Injured=3000
    
    Safe=10000
  • Test Case 2

    Input (stdin)
    12000
    
    13000
    
    110000
    
    
    Expected Output
    TSUNAMI REPORT
    
    The number of people
    
    Dead=12000
    
    Injured=13000
    
    Safe=110000

No comments:

Post a Comment