SHARE
TWEET

12331123

a guest Apr 21st, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     const int N = 2;
  6.     int a[N];
  7.     int i;
  8.     for ( i = 0 ; i < N ; i++)
  9.         scanf("%d", &a[i]);
  10.     int sum = 0, k = 0 ;
  11.     for(i = 0; i < N ; i++)
  12.     {
  13.         sum = sum + a[i];
  14.  
  15.     }
  16.  
  17.     int n = 0;
  18.     for(i = 0; i < N ; i++)
  19.  
  20.  
  21.     {
  22.         if(a[i] > sum)
  23.         {
  24.  
  25.             n = i + 1;
  26.             k++;
  27.  
  28.  
  29.         }
  30.     }
  31.  
  32.  
  33.     printf("%d %d", k, n );
  34.  
  35.  
  36.  
  37.     return 0;
  38. }
RAW Paste Data
Want to get better at C#?
Learn to code C# in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top