Bài tập Lập trình C# căn bản
Số trang: 85
Loại file: pdf
Dung lượng: 0.00 B
Lượt xem: 25
Lượt tải: 0
Xem trước 9 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Ngôn ngữ C# khá đơn giản, chỉ khoảng hơn 80 từ khóa và hơn mười mấy kiểu dữ liệu được dựng sẵn. Tuy nhiên, ngôn ngữ C# có ý nghĩa to lớn khi nó thực thi những khái niệm lập trình hiện đại. C# bao gồm tất cả những hỗ trợ cho cấu trúc, thành phần component, lập trình hướng đối tượng.
Nội dung trích xuất từ tài liệu:
Bài tập Lập trình C# căn bảnBài tập Lập trình C# căn bản L p trình C# - Căn b n KI U SL nh nh p 1 s t bàn phím Console.WriteLine(“Câu thông báo…”); Int So = Int.Parse(Console.ReadLine());Int so01 = 23;Int so02 = 7; → so01 = s01 + 1So01 += so02;Console.WriteLine(“so : {0}”, so01);Console.ReadLine();---------------------------------------------------------------------Int so = 10;so + +; so = so + 1Console.WriteLine(“so : {0}”, so);Console.ReadLine();-------------------------------------------------------------------------------------------------------------------------------Lưu ý:So + + Console.WriteLine(“So : {0}, so + + ); Console.WriteLine(“So :{0}”, so); So = so + 1+ + So Console.WriteLine(“So : {0}, + + so ); So = so + 1 Console.WriteLine(“So :{0}”, so);-------------------------------------------------------------------------------------------------------------------------------Int so01 = 23; Int so02 = 7; Tính: So01 += so02 – –; So01 = so01 + so02; So02 = so02 – 1;KQ: 30/6Int so01 = 23; Int so02 = 7; Tính: So01 += – – so02; So02 = so02 – 1; So01 = so01 + so02;KQ: 29/6 Trang 1 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n LAB TH C HÀNHLab 1: Hàm enumusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab01{ class Program { enum ngaytrongtuan { thuhai, thuba, thutu, thunam, thusau, thubay, chunhat } static void Main(string[] args) { Console.WriteLine(hom nay la : {0},ngaytrongtuan.thutu); Console.WriteLine(hai ngay sau la :{0},ngaytrongtuan.thutu + 2); Console.ReadLine(); } }}Lab 2 – Ki u susing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab02{ class Program { static void Main(string[] args) { int so = 10; so += 5; //so = so + 5 ; Console.WriteLine(gia tri cua so la : {0},so); Console.ReadLine(); Trang 2 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n int so01 = 23; int so02 = 7; so01 -= so02; so01 += so01; // so01 = so01 + so02 Console.WriteLine(gia tri cua so01 la : {0},so01); Console.ReadLine(); } }}Lab 3 – Ki u susing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab03{ class Program { static void Main(string[] args) { int so = 10; so++; Console.WriteLine(so : {0},so++);//viet cw truoc roi +sau Console.WriteLine(so : {0},++so);//+ truoc roi viet cwsau Console.ReadLine(); } }}Lab 4 - Mainusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab04{ class Program { Trang 3 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n static void Main(string[] args) {// re nhanh chuong trinh : submain se viet truoc , roi toimain // khi khong goi Submain thi chuong trinh k chay SubMain(); Console.WriteLine(goi tu Main); Console.ReadLine(); } static void SubMain() { Console.WriteLine(goi tu SubMain); } }}Lab 5 - Tínhusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab05{ ...
Nội dung trích xuất từ tài liệu:
Bài tập Lập trình C# căn bảnBài tập Lập trình C# căn bản L p trình C# - Căn b n KI U SL nh nh p 1 s t bàn phím Console.WriteLine(“Câu thông báo…”); Int So = Int.Parse(Console.ReadLine());Int so01 = 23;Int so02 = 7; → so01 = s01 + 1So01 += so02;Console.WriteLine(“so : {0}”, so01);Console.ReadLine();---------------------------------------------------------------------Int so = 10;so + +; so = so + 1Console.WriteLine(“so : {0}”, so);Console.ReadLine();-------------------------------------------------------------------------------------------------------------------------------Lưu ý:So + + Console.WriteLine(“So : {0}, so + + ); Console.WriteLine(“So :{0}”, so); So = so + 1+ + So Console.WriteLine(“So : {0}, + + so ); So = so + 1 Console.WriteLine(“So :{0}”, so);-------------------------------------------------------------------------------------------------------------------------------Int so01 = 23; Int so02 = 7; Tính: So01 += so02 – –; So01 = so01 + so02; So02 = so02 – 1;KQ: 30/6Int so01 = 23; Int so02 = 7; Tính: So01 += – – so02; So02 = so02 – 1; So01 = so01 + so02;KQ: 29/6 Trang 1 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n LAB TH C HÀNHLab 1: Hàm enumusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab01{ class Program { enum ngaytrongtuan { thuhai, thuba, thutu, thunam, thusau, thubay, chunhat } static void Main(string[] args) { Console.WriteLine(hom nay la : {0},ngaytrongtuan.thutu); Console.WriteLine(hai ngay sau la :{0},ngaytrongtuan.thutu + 2); Console.ReadLine(); } }}Lab 2 – Ki u susing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab02{ class Program { static void Main(string[] args) { int so = 10; so += 5; //so = so + 5 ; Console.WriteLine(gia tri cua so la : {0},so); Console.ReadLine(); Trang 2 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n int so01 = 23; int so02 = 7; so01 -= so02; so01 += so01; // so01 = so01 + so02 Console.WriteLine(gia tri cua so01 la : {0},so01); Console.ReadLine(); } }}Lab 3 – Ki u susing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab03{ class Program { static void Main(string[] args) { int so = 10; so++; Console.WriteLine(so : {0},so++);//viet cw truoc roi +sau Console.WriteLine(so : {0},++so);//+ truoc roi viet cwsau Console.ReadLine(); } }}Lab 4 - Mainusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab04{ class Program { Trang 3 Sangit.design.officelive.com – Email: Sangit.sgu@gmail.com L p trình C# - Căn b n static void Main(string[] args) {// re nhanh chuong trinh : submain se viet truoc , roi toimain // khi khong goi Submain thi chuong trinh k chay SubMain(); Console.WriteLine(goi tu Main); Console.ReadLine(); } static void SubMain() { Console.WriteLine(goi tu SubMain); } }}Lab 5 - Tínhusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace lab05{ ...
Tìm kiếm theo từ khóa liên quan:
ngôn ngữ C++ lập trình C++ lập trình căn bản bài tập lập trình ôn tập lập trình C# tuật toán cấu trúc dữ liệuGợi ý tài liệu liên quan:
-
Đề cương chi tiết học phần Cấu trúc dữ liệu và giải thuật (Data structures and algorithms)
10 trang 317 0 0 -
114 trang 241 2 0
-
80 trang 221 0 0
-
Bài tập lập trình Windows dùng C# - Bài thực hành
13 trang 184 0 0 -
Giải thuật và cấu trúc dữ liệu
305 trang 161 0 0 -
Bài giảng Phân tích thiết kế phần mềm: Chương 1 - Trường ĐH Ngoại ngữ - Tin học TP.HCM
64 trang 150 0 0 -
Tập bài giảng Thực hành kỹ thuật lập trình
303 trang 143 0 0 -
Giáo trình Cấu trúc dữ liệu và thuật toán (Tái bản): Phần 1
152 trang 139 0 0 -
Giáo trình Lập trình C căn bản - HanoiAptech Computer Education Center
136 trang 132 0 0 -
Tài liệu tham khảo: Cấu trúc dữ liệu và giải thuật
229 trang 123 0 0