Saturday, August 18, 2018

IO-26

  • Problem Description

    Write a program to read 10 integers. Display these numbers by printing three numbers in a line separated by commas

    Input and Output Format:

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output.
  • CODING ARENA::
  • #include <stdio.h>
    int main()
    {
      int a,b,c,d,e,f,g,h,i,j;
      scanf("%d%d%d%d%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
      printf("%d,%d,%d\n",a,b,c);
      printf("%d,%d,%d\n",d,e,f);
      printf("%d,%d,%d\n",g,h,i);
      printf("%d",j);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    1 2 3 4 5 6 7 8 9 10
    
    
    Expected Output
    1,2,3
    
    4,5,6
    
    7,8,9
    
    10
  • Test Case 2

    Input (stdin)
    11 12 13 14 15 16 17 18 19 10
    
    
    Expected Output
    11,12,13
    
    14,15,16
    
    17,18,19
    
    10

No comments:

Post a Comment