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

MMA
Differences between revisions 33 and 34
Revision 33 as of 2012-07-14 23:33:06
Size: 732
Editor: hiyakashi
Comment:
Revision 34 as of 2012-07-16 17:50:37
Size: 894
Editor: nomeaning
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
異なっていないように見えます。 [[http://ideone.com/sWn2y]]、[[http://ideone.com/hGDDS]] -- [[nomeaning]] <<DateTime(2012-07-16T17:50:37+0900)>>

C言語

未解決問題

第11行目の有無によって第18行目の出力が異なります。 なぜでしょう?-- rei05 2012-07-11 13:47:51

信心が足りないということでは? -- hiyakashi 2019-10-15 01:40:52

異なっていないように見えます。 http://ideone.com/sWn2yhttp://ideone.com/hGDDS -- nomeaning 2012-07-16 17:50:37

   1 #include<stdio.h>
   2 #include<math.h>
   3 
   4 int main(){
   5         double ans=100000;
   6         int n,i;
   7 
   8         scanf("%d",&n);
   9 
  10         for(i=0;i<n;i++){
  11                 printf("%f\n",fmod(ans*1.05,1000));
  12                 if(fmod(ans*1.05,1000)==0)
  13                         ans*=1.05;
  14                 else
  15                         ans=ans*1.05-fmod(ans*1.05,1000)+1000;
  16         }
  17 
  18         printf("%d\n",(int)ans);
  19         return 0;
  20 }

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