This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define TEXT_LENGTH 200//Length of Question | |
| #define ANSWER_KINDS 4//Numbers of Select Answer | |
| #define ANSWER_LENGTH 30//Length of Answers | |
| #define PLOBLEM_NUMBER 1//Numbers of Question | |
| /* | |
| *Struct of Problem | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //実行結果は(http://ideone.com/PMb48)参照 | |
| /* | |
| *CalcGCD:ユークリッドの互除法により自然数のa,bの最大公約数を計算 | |
| *@val a,b:判定に使う二つの自然数 | |
| */ | |
| int CalcGCD(int a,int b) | |
| { | |
| //a<bの時は、a,bの値を入れ替えて処理続行 | |
| if(a<b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| *(a,b)=(2,5)のときの結果は、http://ideone.com/7OUIv | |
| *(a,b)=(2,6)のときの結果は、http://ideone.com/xp0bF | |
| *を参照のこと | |
| */ | |
| #define MAX_VALUE 100 | |
| #define A 2 | |
| #define B 5 | |
| #include<stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define("MAX_NUMBER","101"); | |
| /* | |
| * How to solve InverseFizzBuzz problem | |
| * Copiled program(実行結果):http://ideone.com/yTOtF | |
| * Inverse FizzBuzz Problem explains:http://code.google.com/p/fizzbuzz/ | |
| * | |
| */ | |
| $str=""; | |
| $str_array=array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include<math.h> | |
| double Average(double *data,int n); | |
| double Verb(double *data,int n); | |
| double Deviation(double *data,int n); | |
| //平均を計算 | |
| double Average(double *data,int n) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| *実行結果:http://ideone.com/nhnON | |
| */ | |
| class A{ | |
| static $val = 5; | |
| public function plus($i){ | |
| return B::Plus($i); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $check =array("10","10x","100","100x"); | |
| foreach($check as $val){ | |
| if("10" === $val){ | |
| echo "+"; | |
| }else{ | |
| echo $val; | |
| } | |
| } |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 1 column, instead of 2 in line 5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------------------------------------- | |
| # http://d.hatena.ne.jp/program_study/ | |
| # 繝ヲ繝シ繧カ繝シ 繧オ繝槭Μ繝シ | |
| # 20120906-20121006 | |
| # ---------------------------------------- | |
| 譌・,險ェ蝠乗焚 | |
| 2012/09/06,0 | |
| 2012/09/07,0 | |
| 2012/09/08,0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //関数のみ記述します | |
| int gauss(double x) | |
| { | |
| if(x<0) | |
| { | |
| return floor(x)-1; | |
| }else | |
| { | |
| return floor(x); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //集合A,B全ての要素を出力する為の関数. | |
| //配列の要素全てが表示される | |
| void array_printf(int array[]) | |
| { | |
| int length = sizeof array /sizeof array[0];//calculate length of array | |
| int i=0; | |
| //output message | |
| printf("arrays:"); | |
| //output contents of array |