Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- loop
- dynamic
- 파이썬
- Tutorial
- UE5
- Material
- 문제풀이
- parameter
- Algorithm
- github
- W3Schools
- Class
- 재귀
- python
- 오류
- 시작해요 언리얼 2022
- Unreal Engine 5
- 백준
- Basic
- DP
- c++
- 프로그래밍
- Unity
- C#
- w3school
- 기초
- guide
- dfs
- Programming
- String
Archives
- Today
- Total
행복한 개구리
C# 0309 ★for, ★while, do while, foreach 본문
int count = 0;
for (int i = 0; i < 5; i++)
{
Console.WriteLine("줄넘기를 {0}회 했습니다.", i+1);
count++;
}
Console.WriteLine("총 줄넘기한 횟수 : {0}", count);
//줄넘기를 1회 했습니다.
//줄넘기를 2회 했습니다.
//줄넘기를 3회 했습니다.
//줄넘기를 4회 했습니다.
//줄넘기를 5회 했습니다.
//**********************
//총 줄넘기한 횟수 : 5회
int n = 0;
while (n<5)
{
Console.WriteLine(n);
n++;
}
Console.WriteLine("{0}회 실행되었습니다.", n);
=======================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Homework000
{
class Program
{
static void Main(string[] args)
{
int n = 0;
do
{
Console.WriteLine(n);
n++;
} while (n < 5);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Homework000
{
class Program
{
static void Main(string[] args)
{
string[] names = new string[3] { "홍길동", "임꺽정", "장길산" };
foreach (string name in names)
{
Console.WriteLine(name);
}
}
}
}
'C# > 수업내용' 카테고리의 다른 글
C# 0309 커멘드센터 SCV (0) | 2021.03.09 |
---|---|
C# 0309 ★break, ★continue (0) | 2021.03.09 |
C# 0309 ★if와 ★switch (0) | 2021.03.09 |
0309 C# 강화 성공, 실패 (0) | 2021.03.09 |
0309 C# Random 크리티컬 || && (0) | 2021.03.09 |