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;
int p;
int main()
{
cin>>p;
cout<<p/60<<":"<<p%60;
}
#include <bits/stdc++.h>
using namespace std;
int p;
int main()
{
cin>>p;
int a=p/3600;
p=p-a*3600;
int b=p/60;
int c=p%60;
cout<<a<<":"<<b<<":"<<c;
}
#include <iostream>
using namespace std;
int main()
{
int t;
cin >> t;
int h = t / 3600;
int m = (t % 3600) / 60;
int s = (t % 3600) % 60;
cout << h << ":" << m << ":" << s << endl;
return 0;
}
Cái này mình viết chương trình chính thôi, bạn tự viết ctc nhé
Câu 1:
uses crt;
var n,i,s:longint;
begin
clrscr;
write('Nhap n='); readln(n);
s:=1;
for i:=1 to n do
s:=s*i;
writeln(s);
readln;
end.
Câu 2:
uses crt;
var st:string;
i,d:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=d downto 1 do
write(st[i]);
readln;
end.
uses crt; var a,b:array[1..100000]of integer; i,n,kt,j,dem,x,y,kt1:integer; st,st1:string; begin clrscr; write('Nhap n='); readln(n); for i:=1 to n do begin write('A[',i,']='); readln(a[i]); end; dem:=0; for i:=1 to n do if a[i]>1 then begin kt:=0; for j:=2 to a[i]-1 do if a[i] mod j=0 then begin kt:=1; break; end; if kt=0 then begin inc(dem); b[dem]:=a[i]; end; end; for i:=1 to dem do begin str(a[i],st); st1:=''; for j:=length(st) downto 1 do st1:=st1+st[j]; val(st1,x,y); kt1:=0; for j:=2 to x-1 do if x mod j=0 then begin kt1:=1; break; end; if kt1=0 then write(a[i]:4); end; readln; end.
uses crt; var a,b:array[1..100000]of integer; i,n,kt,j,dem,x,y,kt1:integer; st,st1:string; begin clrscr; write('Nhap n='); readln(n); for i:=1 to n do begin write('A[',i,']='); readln(a[i]); end; dem:=0; for i:=1 to n do if a[i]>1 then begin kt:=0; for j:=2 to a[i]-1 do if a[i] mod j=0 then begin kt:=1; break; end; if kt=0 then begin inc(dem); b[dem]:=a[i]; end; end; for i:=1 to dem do begin str(a[i],st); st1:=''; for j:=length(st) downto 1 do st1:=st1+st[j]; val(st1,x,y); kt1:=0; for j:=2 to x-1 do if x mod j=0 then begin kt1:=1; break; end; if kt1=0 then write(a[i]:4); end; readln; end.
uses crt;
var p,a,b:integer;
begin
clrscr;
readln(p)
a:=p div 60;
b:=p mod 60;
write(a,':',b);
readln;
end.
uses crt;
var a:array[1..100]of integer;
n,k,t,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(n);
end;
for i:=n downto 1 do
write(a[i]:4);
writeln;
write('Nhap k='); readln(k);
t:=0;
for i:=1 to n do
if k mod a[i]=0 then t:=t+a[i];
writeln(t);
for i:=1 to n do
if a[i]=k then write(i:4);
readln;
end.
tham khảo
Program Hotboy;
Uses crt;
Var A:array[1..100] of integer;
I,n : byte;
S:real;
Begin
Clrscr ;
S:=1;
Write('nhao so phan tu trong day'); readln(n);
For i:=1 to n do
Begin
Write('A[',i,']'); readln(A[i]);
End;
For i:=1 to n do
If A[i] mod 5 =0 then
S:=S* A[i] ;
Writeln('Tong cac phan tu chia het cho 5 trong mang la',S);
Readln
End.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
readln(n);
t:=1;
for i:=1 to n do
if a[i] mod 2<>0 then t:=t*a[i];
writeln(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
cin>>a[i];
for (i=1; i<=n; i++) cout<<a[i]<<" ";
return 0;
}
uses crt;
var st:string;
d,i,n:integer;
begin
clrscr;
readln(n);
str(n,st);
d:=length(st);
for i:=d downto 1 do
write(st[i]);
readln;
end.