fork download
  1. #include <stdio.h>
  2.  
  3. #define NUM 10
  4.  
  5. int main(void) {
  6. int i;
  7. int score[NUM];
  8. float new_score[NUM];
  9. int max_score, min_score;
  10.  
  11. max_score=0;
  12. min_score=100;
  13.  
  14. for ( i=0 ; i < NUM ; i++ ){
  15. printf("\n%d人目の点数:",i+1);
  16. scanf("%d",&score[i]);
  17. if(max_score<score[i]){
  18. max_score=score[i];
  19. }
  20. if(min_score>score[i]){
  21. min_score=score[i];
  22. }
  23. }
  24.  
  25. printf("\n\n最高点:%d ",max_score);
  26. printf("最低点:%d\n",min_score);
  27.  
  28. for(i=0;i<NUM;i++){
  29. new_score[i]=((50.00000*(score[i]-min_score))/(max_score-min_score))+50;
  30. printf("\n%d人目:%d→%f",i+1,score[i],new_score[i]);
  31. }
  32. }
  33.  
Success #stdin #stdout 0s 5328KB
stdin
34
97
12
43
22
38
24
54
12
37
stdout
1人目の点数:
2人目の点数:
3人目の点数:
4人目の点数:
5人目の点数:
6人目の点数:
7人目の点数:
8人目の点数:
9人目の点数:
10人目の点数:

最高点:97 最低点:12

1人目:34→62.941177
2人目:97→100.000000
3人目:12→50.000000
4人目:43→68.235291
5人目:22→55.882355
6人目:38→65.294121
7人目:24→57.058823
8人目:54→74.705879
9人目:12→50.000000
10人目:37→64.705879