using System; namespace PhuongTrinhBacNhat{ class Program { static void Main(string[] args) { Console.Write("Nhap he so a :"); int a = int.Parse(Console.ReadLine()); Console.Write("Nhap he so b :"); int b = int.Parse(Console.ReadLine()); if (a == 0) if (b == 0) Console.WriteLine("Phuong trinh co vo so nghiem"); else Console.WriteLine("Phuong trinh vo nghiem "); else{ int ketqua = -b / a; Console.WriteLine("Phuong trinh co nghiem la x = {0}", ketqua.ToString()); } Console.ReadKey(); } } }
Related Post:
PHP: Tự động tạo mật khẩu ngẫu nhiên - PHP Password GeneratingTự động tạo mật khẩu ngẫu nhiên - PHP Password GeneratingPHP Code:<?phpfunction genPwd($length=6) { $password = ''; $possible = '23456789bcdfghjkmnpqrstvwxyz'; $i = 0; while ($i < $length) { $password .= substr($possible, mt_rand(0, strlen($possible)-1), 1); $i++; …Read More
PHP: Lớp kết nối MySQL với PHP bằng câu lệnh đơn giảnPHP Code:class mysql{var $property = array( 'hostname' => 'localhost', 'database' => '', 'username' => '', 'password' => '',);function mysql($info){foreach($this->property as $k => $v){$this->property[$k]=$info[$k];}}function connec…Read More
PHP: Các hàm PHP xử lý chuỗiCác hàm PHP xử lý chuỗi1: addcslashes :Trích dẫn chuỗi kí tự với những vạch chéo trong kiểu C- Cấu trúc :addcslashes(string with special characters);2: addslashes :Trích dẫn chuỗi kí tự với những vạch chéo- Cấu trúc : addcslashes(a string with special characters);3: bin2hex :Chuyển đổi dữ liệu dạng nhị phân sang dạng biểu diễn hệ hexa- Cấu trúc :bin2hex(string);4: cho…Read More
Code C++: Cho mảng một chiều các số nguyên. Viết hàm tìm chữ số xuất hiện nhiều nhất trong mảng.Cho mảng một chiều các số nguyên. Viết hàm tìm chữ số xuất hiện nhiều nhất trong mảng.int timchuso(int a[],int n){ int temp[100]; int max = 0;int number = a[0]; // Khởi tạo giá trị 0 cho mảngfor(int j = 0;j<100;j++){ temp[j]=0; } //Tìm chữ số xuất hiệnfor(int i = 0 ; i < n ; i++){ temp[a[i]]=temp[a[i]] + 1; if(max < temp[a[…Read More
Klik untuk melihat kode: