はてな?プログラム

日常?プログラム?描くのかな

if

#include <stdio.h> int main() { int n = 10; if( n == 10 ) { printf("同じ\n"); } else { printf("違う\n"); } return 0; } 出力 同じ ifは、()の中の条件によって{}内のプログラムを読み飛ばしたりしなかったりする? elseは、ifの条件に当てはまらないやつ?を実</stdio.h>…

足し算、引き算、掛け算、割り算、あまり

#include <stdio.h> int main() { printf("%d+%d=%d\n", 10, 5, 10+5 );// 足し算 printf("%d-%d=%d\n", 10, 5, 10-5 );// 引き算 printf("%d×%d=%d\n", 10, 5, 10*5 );// 掛け算 printf("%d÷%d=%d あまり%d\n", 10, 5, 10/5, 10%5 );// 割り算 return 0; } 出力 10+5</stdio.h>…

数値?

#include <stdio.h> int main(){ int number; number=10; printf("%d\n", number ); return 0;} 出力 10 intでnumberって名前の入れ物?を宣言? 入れ物?の名前は好きなものにしてもいいの? でもダメなものもある? =で10って数値をnumberに入れてる? 入れ物?に入</stdio.h>…

HTML

HTMLのメモ? <p>p</p> p <pre>pre</pre> pre <code>code</code> code <span style="color: #ff0000">赤</span> 赤 <span style="color: #00ff00">緑</span> 緑 <span style="color: #0000ff">青</span> 青 <input type="button" value="ボタン"> ボタンを押しても何も起きないどうやってイベントを起こすのかな?

文字表示

Hello world! を表示するプログラム #include <stdio.h>int main() { printf( "Hello world!\n" ); return 0;} printfを使うのに#include <stdio.h>が必要? printf("");の""の間にある文字を表示するらしい? \nは、改行らしいです。</stdio.h></stdio.h>

何もなしプログラム

何もしないプログラム #include <stdio.h> int main( void ) { return 0; } #include <stdio.h> は、よく分からないけど<>内のファイルの読み込み? int は、関数の宣言? main( void )を使うと? void も、宣言? よく分からない mainの( )中の void は、省略可能らしいそうで</stdio.h></stdio.h>…