'Console/Algorithm'에 해당되는 글 17건

  1. 2019.10.15 1546 평균
  2. 2019.10.15 2577 숫자의 개수
  3. 2019.09.30 2739 구구단
  4. 2019.09.28 10817 세수
  5. 2019.09.27 2753 윤년
  6. 2019.09.27 1330 두 수 비교하기
  7. 2019.09.27 9498 시험성적
  8. 2019.09.27 2588 곱셈
  9. 2019.09.27 10430 나머지
  10. 2019.09.27 10869 사칙연산

1546 평균

Console/Algorithm 2019. 10. 15. 21:44
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
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax1
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            int[] arr = new int[n];
            var input = Console.ReadLine();
            var arr2 = input.Split(' ');
            int m = 0;
            for (int i = 0; i < arr2.Length; i++)
            {
                arr[i] = int.Parse(arr2[i]);
                if (arr[i] > m)
                {
                    m = arr[i];
                }
            }
            float b = 0;
            for (int j = 0; j < arr2.Length; j++)
            {
               var c = (float)arr[j] /(float) m * 100;
                b = b + c;
            }
            Console.WriteLine(b / (float)n);
        }
 
    }
 
}
 
 
 
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

2577 숫자의 개수  (0) 2019.10.15
2739 구구단  (0) 2019.09.30
10817 세수  (0) 2019.09.28
2753 윤년  (0) 2019.09.27
1330 두 수 비교하기  (0) 2019.09.27

2577 숫자의 개수

Console/Algorithm 2019. 10. 15. 21:44
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int d = a * b * c;
            string e = Convert.ToString(d);
            int[] count = new int[10];
            int[] f = new int[e.Length];
            for (int i = 0; i < e.Length; i++)
            {
                f[i] = int.Parse(e[i].ToString());
            }
            for (int j = 0; j < count.Length; j++)
            {
                for (int k = 0; k < e.Length; k++)
                {
                    if (f[k] == j)
                    {
                        count[j]++;
                    }
                }
            }
            for (int l = 0; l < count.Length; l++)
            {
                Console.WriteLine(count[l]);
            }
        }
 
    }
 
}
 
 
 
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

1546 평균  (0) 2019.10.15
2739 구구단  (0) 2019.09.30
10817 세수  (0) 2019.09.28
2753 윤년  (0) 2019.09.27
1330 두 수 비교하기  (0) 2019.09.27

2739 구구단

Console/Algorithm 2019. 9. 30. 08:57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            {
                int a = int.Parse(Console.ReadLine());
                for(int b = 1; b < 10; b++)
                {
                    Console.WriteLine($"{ a} * { b} = {a*b}");
                }
            }
        }
    }
        
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

1546 평균  (0) 2019.10.15
2577 숫자의 개수  (0) 2019.10.15
10817 세수  (0) 2019.09.28
2753 윤년  (0) 2019.09.27
1330 두 수 비교하기  (0) 2019.09.27

10817 세수

Console/Algorithm 2019. 9. 28. 16:35

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax1
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            string[] arr = input.Split(' ');
            int a = int.Parse(arr[0]);
            int b = int.Parse(arr[1]);
            int c = int.Parse(arr[2]);
            if (a > b)
            {
                if (a > c)
                {
                    if (b > c)
                    {
                        Console.WriteLine(b);
                    }
                    else
                    {
                        Console.WriteLine(c);
                    }
                }
                else
                {
                    Console.WriteLine(a);
                }
            }
            else
            {
                if (a > c)
                {
                    Console.WriteLine(a);
                }
                else
                {
                    if(b>c)
                    {
                        Console.WriteLine(c);
                    }
                    else
                    {
                        Console.WriteLine(b);
                    }
                }
            }
        }
 
    }
 
}
 
 
 
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

2577 숫자의 개수  (0) 2019.10.15
2739 구구단  (0) 2019.09.30
2753 윤년  (0) 2019.09.27
1330 두 수 비교하기  (0) 2019.09.27
9498 시험성적  (0) 2019.09.27

2753 윤년

Console/Algorithm 2019. 9. 27. 23:43

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
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax1
{
    class Program
    {
        static void Main(string[] args)
        {
            int A = int.Parse(Console.ReadLine());
            if (A % 4 == 0 && A % 100 != 0||A%4==0&&A%400==0)
            {
                Console.WriteLine(1);
            }
            else
            {
                Console.WriteLine(0);
            }
 
           
        }
 
    }
 
}
 
 
 
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 
 

'Console > Algorithm' 카테고리의 다른 글

2739 구구단  (0) 2019.09.30
10817 세수  (0) 2019.09.28
1330 두 수 비교하기  (0) 2019.09.27
9498 시험성적  (0) 2019.09.27
2588 곱셈  (0) 2019.09.27

1330 두 수 비교하기

Console/Algorithm 2019. 9. 27. 23:17

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
string input = Console.ReadLine();
            string[] arr = input.Split(' ');
            int A = int.Parse(arr[0]);
            int B = int.Parse(arr[1]);
 
            if (A > B)
            {
                Console.WriteLine(">");
            }
            else if (A < B)
            {
                Console.WriteLine("<");
            }
            else
            {
                Console.WriteLine("==");
            }
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

10817 세수  (0) 2019.09.28
2753 윤년  (0) 2019.09.27
9498 시험성적  (0) 2019.09.27
2588 곱셈  (0) 2019.09.27
10430 나머지  (0) 2019.09.27

9498 시험성적

Console/Algorithm 2019. 9. 27. 23:05
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
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Syntax1
{
    class Program
    {
        static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            if (90<=input&&input<=100)
            {
                Console.WriteLine("A");
            }
            else if (input >= 80 && input < 90)
            {
                Console.WriteLine("B");
            }
            else if (input >= 70 && input < 80)
            {
                Console.WriteLine("C");
            }
            else if (input >= 60 && input < 70)
            {
                Console.WriteLine("D");
            }
            else
            {
                Console.WriteLine("F");
            }
 
 
        }
 
    }
 
}
 
 
            
      
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

2753 윤년  (0) 2019.09.27
1330 두 수 비교하기  (0) 2019.09.27
2588 곱셈  (0) 2019.09.27
10430 나머지  (0) 2019.09.27
10869 사칙연산  (0) 2019.09.27

2588 곱셈

Console/Algorithm 2019. 9. 27. 13:32
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            {
                string input1 = Console.ReadLine();
                string input2 = Console.ReadLine();
                int a = int.Parse(input2[0].ToString());
                int b = int.Parse(input2[1].ToString());
                int c = int.Parse(input2[2].ToString());
                int d = int.Parse(input2);
                int e = int.Parse(input1);
                Console.WriteLine(e * c);
                Console.WriteLine(e * b);
                Console.WriteLine(e * a);
                Console.WriteLine(e * d);
            }
        }
    }
        
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

1330 두 수 비교하기  (0) 2019.09.27
9498 시험성적  (0) 2019.09.27
10430 나머지  (0) 2019.09.27
10869 사칙연산  (0) 2019.09.27
1008 A/B  (0) 2019.09.27

10430 나머지

Console/Algorithm 2019. 9. 27. 11:36
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            {
                string s = Console.ReadLine();
                string[] ss = s.Split();
                int a = int.Parse(ss[0]);
                int b = int.Parse(ss[1]);
                int c = int.Parse(ss[2]);
                Console.WriteLine((a + b) % c);
                Console.WriteLine((a % c + b % c) % c);
                Console.WriteLine((a * b) % c);
                Console.WriteLine((a % c * b % c) % c);
            }
        }
    }
        
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 

'Console > Algorithm' 카테고리의 다른 글

9498 시험성적  (0) 2019.09.27
2588 곱셈  (0) 2019.09.27
10869 사칙연산  (0) 2019.09.27
1008 A/B  (0) 2019.09.27
9655 돌 게임  (0) 2019.09.26

10869 사칙연산

Console/Algorithm 2019. 9. 27. 11:27
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            {
                string s = Console.ReadLine();
                string[] ss = s.Split();
                int a = int.Parse(ss[0]);
                int b = int.Parse(ss[1]);
                Console.WriteLine(a + b);
                Console.WriteLine(a - b);
                Console.WriteLine(a * b);
                Console.WriteLine(a / b);
                Console.WriteLine(a % b);
            }
        }
    }
        
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
 


10869

'Console > Algorithm' 카테고리의 다른 글

2588 곱셈  (0) 2019.09.27
10430 나머지  (0) 2019.09.27
1008 A/B  (0) 2019.09.27
9655 돌 게임  (0) 2019.09.26
10998 A x B  (0) 2019.09.25