viet chuong trinh cho phep nhap diem kiem tra 1 ban nao do va in ra man hinh ket qua: neu diem nho hon 5 thi ban can co gang hon. neu ban lon hon hoac =5 va nho hon 6,5 thi ban dat diem trung binh. neu diem lon hon hoac = 6,5 va nho hon 8 thi ban dat diem kha. neu diem lon hon hoac = 8 thi ban dat diem gioi
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
using namespace std;
#include <bits/stdc++.h>
int main() {
int n;
cin >> n;
int total = 0;
for (int i = 1; i <= n; i++) {
if (i % 20 == 0 && i % 10 != 0) {
if (i <= (n / 10)) {
total += i * i;
}
} else {
total += i;
}
}
cout << "The total is: " << total << endl;
for (int i = 0; i < n; i++) {
int du = i % 10;
int tongcacso = i % 10 * i % 10 * i % 10;
cout << "du = " << du << endl;
total += du * du * du;
cout << "\nsum = " << total << endl;
cout << "sum = (sum+i*i*i) " << endl;
}
return 0;
}
uses crt;
var n,i:integer;
kt:boolean;
begin
clrscr;
repeat
readln(n);
until n<=100;
if (n<2) then writeln('khong la so nguyen to')
else begin
kt:=true;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then kt:=false;
if kt=true then write('la so nguyen to')
else write('khong la so nguyen to');
end;
readln;
end.
uses crt;
var n,i:integer;
kt:boolean;
begin
clrscr;
repeat
readln(n);
until n<=100;
if (n<2) then writeln('khong la so nguyen to')
else begin
kt:=true;
for i:=2 to trunc(sqrt(n)) do
if n mod i=0 then kt:=false;
if kt=true then write('la so nguyen to')
else write('khong la so nguyen to');
end;
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('n='); readln(n);
if (n>0) and (n<=100) then
begin
t:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if (a[i] mod 2=0) or (a[i] mod 2=1) then t:=t+a[i];
end;
writeln('tong cac phan tu chan hoac le trong day la: ',t);
end
else writeln('vui long nhap lai');
readln;
end.
Goi so cau dung la a , so cau sai va so cau ko lam la b
So diem cua Thang duoc tinh theo cong thuc la :
5 . a - 5 . b = 25 ( diem )
Co 5a - 5b = 5 . 5
5( a - b ) = 5 . 5
=> a - b = 5
Co a + b = 15
=> a = 5 + b
a = 15 - b
=> 5 + b = 15 - b
=> b + b = 15 - 5
=> 2b = 10
=> b = 5
=> a + b = 15
=> a = 10
Vay Thang lam dung 10 cau
uses crt;
var diem:real;
begin
clrscr;
write('nhap diem:'); readln(diem);
if diem<5 then writeln('ban can co gang hon');
if (diem>=5) and (diem<6.5) then writeln('ban dat diem trung binh');
if (diem>=6.5) and (diem<8) then writeln('ban dat diem kha');
if diem>=8 then writeln('ban dat diem gioi');
readln;
end.