Login
Immutable PageDiscussionInfoAttachments
Diff for "rei05/C言語"

MMA
Differences between revisions 21 and 22
Revision 21 as of 2012-05-22 17:19:31
Size: 1081
Editor: rei05
Comment:
Revision 22 as of 2012-05-22 17:40:46
Size: 1146
Editor: rei05
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
 * [[http://wiki.mma.club.uec.ac.jp/rei05/C言語/10027|10027]]

C言語

AOJ解答

  • 最終的にAcceptedとなった回答です。

Help Me!

未解決

#include<stdio.h>
#include<math.h>
int main(){

int n,s[1000],i,m1,m2;
double a;

while(1){
  m1=0;m2=0;
  scanf("%d",&n); if(n==0) break;
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
    m1+=s[i];
  }
  for(i=0;i<n;i++){
    m2+=pow(s[i]-m1/n,2);
  }
  a=fabs(sqrt(m2/n));
  printf("%f\n",a);
}

return(0);
}

rei05/C言語 (last edited 2012-07-16 17:50:37 by nomeaning)