fork(1) download
  1. #include <stdio.h>
  2. int main(void) {
  3. int numbers[8] = {3, -10, 6, 0, 2, -1, 8, 5};
  4. int second, count=0, i, j;
  5. for(i=0;i<8;i++){
  6. second = numbers[i];
  7.  
  8. for(j=0;j<8;j++){
  9. if(second < numbers[j]) count++;
  10. }
  11. if(count==1) break;
  12. }
  13. printf("2番目に大きな数は%d\n", second);
  14. return 0;
  15. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
2番目に大きな数は5