SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
main関数から処理が始まります
変数
Hello
1.5
入力 出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
string型の変数textを宣言します
text
変数
Hello
1.5
入力 出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
double型の変数dを宣言します
text
d
変数
Hello
1.5
入力 出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
textで入力を受け取ります
textの値は”Hello”になります
text = “Hello”
変数
Hello
1.5
入力 出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
dで入力を受け取ります
dの値は1.5になります
text = “Hello”
d = 1.5
変数
Hello
1.5
入力 出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
textとdの値を出力します
Hello, 1.5と出力されます
text = “Hello”
d = 1.5
変数
Hello
1.5
入力
Hello, 1.5
出力
01. #include <bits/stdc++.h>
02. using namespace std;
03.
04. int main() {
05. string text;
06. double d;
07. cin >> text;
08. cin >> d;
09. cout << text << ", " << d << endl;
10. }
main関数の}に到達したのでプログラムを終了します
text = “Hello”
d = 1.5
変数
Hello
1.5
入力
Hello, 1.5
出力

Contenu connexe

Tendances

みんな大好き! Hello, World
みんな大好き! Hello, Worldみんな大好き! Hello, World
みんな大好き! Hello, World
Naohiro Aota
 
新しくプログラミング言語・・・Rubyでやってみた
新しくプログラミング言語・・・Rubyでやってみた新しくプログラミング言語・・・Rubyでやってみた
新しくプログラミング言語・・・Rubyでやってみた
Tomoaki Ueda
 

Tendances (19)

みんな大好き! Hello, World
みんな大好き! Hello, Worldみんな大好き! Hello, World
みんな大好き! Hello, World
 
C++でHello worldを書いてみた
C++でHello worldを書いてみたC++でHello worldを書いてみた
C++でHello worldを書いてみた
 
業務報告会
業務報告会業務報告会
業務報告会
 
C#6.0の新機能紹介
C#6.0の新機能紹介C#6.0の新機能紹介
C#6.0の新機能紹介
 
新しくプログラミング言語・・・Rubyでやってみた
新しくプログラミング言語・・・Rubyでやってみた新しくプログラミング言語・・・Rubyでやってみた
新しくプログラミング言語・・・Rubyでやってみた
 
プロトコル指向 - 夢と現実の狭間 #cswift
プロトコル指向 - 夢と現実の狭間 #cswiftプロトコル指向 - 夢と現実の狭間 #cswift
プロトコル指向 - 夢と現実の狭間 #cswift
 
Goの文法の実例と解説
Goの文法の実例と解説Goの文法の実例と解説
Goの文法の実例と解説
 
String representation in py3k
String representation in py3kString representation in py3k
String representation in py3k
 
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来Protocol-Oriented Integers に想うジェネリックプログラミングの未来
Protocol-Oriented Integers に想うジェネリックプログラミングの未来
 
AVAの話 #mentaicojs
AVAの話 #mentaicojsAVAの話 #mentaicojs
AVAの話 #mentaicojs
 
Swift 3 を書くときに知っておきたい API デザインガイドライン #love_swift #akibaswift
Swift 3 を書くときに知っておきたい API デザインガイドライン #love_swift #akibaswiftSwift 3 を書くときに知っておきたい API デザインガイドライン #love_swift #akibaswift
Swift 3 を書くときに知っておきたい API デザインガイドライン #love_swift #akibaswift
 
ナウなヤングにバカうけのイカしたタグ付き共用体
ナウなヤングにバカうけのイカしたタグ付き共用体ナウなヤングにバカうけのイカしたタグ付き共用体
ナウなヤングにバカうけのイカしたタグ付き共用体
 
言語処理系入門4
言語処理系入門4言語処理系入門4
言語処理系入門4
 
X hago2 shortcoding 20110827
X hago2 shortcoding 20110827X hago2 shortcoding 20110827
X hago2 shortcoding 20110827
 
Swift らしい表現を目指そう #eventdots
Swift らしい表現を目指そう #eventdotsSwift らしい表現を目指そう #eventdots
Swift らしい表現を目指そう #eventdots
 
Mock and patch
Mock and patchMock and patch
Mock and patch
 
関数
関数関数
関数
 
Emcjp item21
Emcjp item21Emcjp item21
Emcjp item21
 
Swift 3 で新しくなったところ - 表面から見えにくいところを中心に紹介 #ISAOcorp
Swift 3 で新しくなったところ - 表面から見えにくいところを中心に紹介 #ISAOcorpSwift 3 で新しくなったところ - 表面から見えにくいところを中心に紹介 #ISAOcorp
Swift 3 で新しくなったところ - 表面から見えにくいところを中心に紹介 #ISAOcorp
 

入力

  • 1. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } main関数から処理が始まります 変数 Hello 1.5 入力 出力
  • 2. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } string型の変数textを宣言します text 変数 Hello 1.5 入力 出力
  • 3. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } double型の変数dを宣言します text d 変数 Hello 1.5 入力 出力
  • 4. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } textで入力を受け取ります textの値は”Hello”になります text = “Hello” 変数 Hello 1.5 入力 出力
  • 5. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } dで入力を受け取ります dの値は1.5になります text = “Hello” d = 1.5 変数 Hello 1.5 入力 出力
  • 6. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } textとdの値を出力します Hello, 1.5と出力されます text = “Hello” d = 1.5 変数 Hello 1.5 入力 Hello, 1.5 出力
  • 7. 01. #include <bits/stdc++.h> 02. using namespace std; 03. 04. int main() { 05. string text; 06. double d; 07. cin >> text; 08. cin >> d; 09. cout << text << ", " << d << endl; 10. } main関数の}に到達したのでプログラムを終了します text = “Hello” d = 1.5 変数 Hello 1.5 入力 Hello, 1.5 出力