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 <bits/stdc++.h>
using namespace std;
long long a,b,c,t;
int main()
{
cin>>a>>b>>c;
t=0;
if (a%2!=0) t=t+a;
if (b%2!=0) t=t+b;
if (c%2!=0) t=t+c;
cout<<t;
return 0;
}
Câu 2:
Program nii;
Uses crt;
Var a,b,c,A:integer;
Begin
Write ('nhap a');
Readln (a);
Write ('nhap b');
Readln (b);
Write ('nhap c');
Readln (c);
A:=a;
If A<b then A:=b;
If A<c then A:=c;
Write ('Ket qua',A);
Readln;
End.
Câu 1
Program ntg;
Uses crt;
Var A,x,y:integer;
Begin
Write ('nhap x');
Readln (x);
Write ('nhap y');
Readln ('y');
A:=x+y;
Write ('Ket qua',A);
Readln;
End.
uses crt;
var a,b,c,s,x:integer;
begin
clrscr;
write('hs_lop');
writeln('nhap 3 so=');readln(a,b,c);
begin
s:=a+b+c;
writeln('tong la:',s);
x:=a*b*c;
writeln('tich la:',x);
end;
if a mod 2 =0 then writeln(a,'la so chan')
else write('a,'la so le');
readln;
end.
mình ko chắc pn kt thử xem
uses crt;
var a:array[1..1000000] of longint;
n,i,s:longint;
begin
clrscr;
write('Nhap so luong phan tu: '); readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': '); readln(a[i]);
if a[i] mod 2=1 then inc(s,a[i]);
end;
write('Tong cac so le: ',s);
readln;
end.
program so_le;
uses crt;
var
n,i,d:integer;
a:Array[1..32000] of integer;
begin
clrscr;
write('nhap n: ');
readln(n);
for i:= 1 to n do
begin
write('nhap a[',i,']: ');
readln(a[i]);
end;
d:=0;
for i:= 1 to n do
if a[i] mod 2 <> 0 then d:=d+1;
write('so luong so nguyen la so le la: ',d);
readln;
end.
Var a:array[1..200] of integer;
i,n,s:integer;
begin
write('Nhap so luong phan tu n = ');readln(n);
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,' = ');readln(a[i]);
end;
for i:=1 to n do
if a[i] mod 2 = 0 then s:=s+a[i];
write('Tong cac so chan la ',s);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
for i:=1 to n do write(a[i]:4);
writeln;
t:=0;
for i:=1 to n do
if a[i]>0 then t:=t+a[i];
writeln(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,t;
int main()
{
cin>>a>>b>>c;
t=0;
if (a%2!=0) t=t+a;
if (b%2!=0) t=t+b;
if (c%2!=0) t=t+c;
cout<<t;
return 0;
}