2016/11/30

M90H007:考試調分(低成60高100)

#include <iostream>
using namespace std;
int main(){
    int a,minScore=9999,maxScore=-9999;
    int scores[60];
    for(int i=0;i<60;i++){
     cin >>a;
     scores[i]=a;
     if(a>maxScore) maxScore=a;
     if(a<minScore) minScore=a;
    }
    for(int i=0;i<60;i++){
     int ans=(100-60)*(scores[i]-minScore)/(maxScore-minScore)+60;
     cout <<ans<<"\n";
    }
 return 0;
}

沒有留言:

張貼留言