성적의 총점과 평균을 출력하는 프로그램
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RoadBook.CsharpBasic.Chapter01.Examples
{
class Ex007
{
public void Run()
{
int kor = 100;
int eng = 100;
int mat = 98;
int phy = 97;
int total = kor + eng + mat + phy;
Console.WriteLine("성적 총점: {0}", total, kor);
Console.WriteLine("평균: {0}", (double)total / 4);
}
}
}
'IT > C#' 카테고리의 다른 글
C# (객체지향_자동차 클래스 설계) (0) | 2021.05.06 |
---|---|
C# (은행 ATM 기기 프로그램) (0) | 2021.05.06 |
C# (사용자가 랜덤 숫자를 맞추는 프로그램) (0) | 2021.05.06 |
C# (팩토리얼 구하기) (0) | 2021.05.06 |
C# (전역변수와 지역변수 차이) (0) | 2021.05.06 |