Nhập chương trình nhập vào số giây t. In ra màn hình số giờ, số phút, số giây.

K
Khách

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.

6 tháng 8 2023

#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; 

}

7 tháng 8 2023

#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;

}

6 tháng 8 2023

#include <bits/stdc++.h>

using namespace std;

int p;

int main()

{

cin>>p;

cout<<p/60<<":"<<p%60;

}

6 tháng 8 2023

uses crt;

var p,a,b:integer;

begin

clrscr;

readln(p)

a:=p div 60;

b:=p mod 60;

write(a,':',b);

readln;

end.

8 tháng 8 2023

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.

26 tháng 9 2025

Các thiết bị vào – ra là nhóm các thiết bị ngoại vi đa dạng và phong phú nhất của máy tính.

+ Các thiết bị vào cho phép nhập dữ liệu vào máy tính như bàn phím, chuột…

+ Các thiết bị ra chuyển thông tin từ máy tính ra ngoài như màn hình, máy in, máy chiếu

+ Một số thiết bị có khả năng trao đổi thông tin hai chiều với máy tính có thể được coi vừa là thiết bị vào, vừa là thiết bị ra. Ví dụ các bộ nhớ ngoài kết nối theo cổng USB


26 tháng 9 2025

BỐ TAO CŨNG KHÔNG BIẾT


30 tháng 10 2017

\(\dfrac{14}{7}hay\dfrac{17}{7}?\)

30 tháng 10 2017

\(\dfrac{14}{7}\)

13 tháng 5 2020

Program HOC24;

var a: array[1..100] of integer;

i,n,d: integer;

t: longint;

begin

write('Nhap so phan tu n='); readln(n);

d:=0;

for i:=1 to n do

begin

write('a[',i,']='); readln(a[i]);

if a[i]>0 then

begin

d:=d+1;

t:=t+a[i];

end;

end;

write('Trung binh cong cac so duong trong mang la :',t/d:1:2);

readln

end.

14 tháng 5 2020

cảm ơn ạ ^^

13 tháng 10 2019

Program hotrotinhoc;

const fi='lientiep.inp';

fo='lientiep.out';

var f: text;

a,b: array[1..32000] of integer;

k,i,n,max,vtd,vtc: integer;

procedure ip;

begin

assign(f,fi);

reset(f);

readln(f,n,k);

for i:=1 to n do read(f,a[i]);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

max:=0; i:=1;

while i<=n do

begin

j:=i;

t:=a[i];

while (a[j]<a[j+1]) and (j<=n) do

begin

inc(j);

t:=t+a[j];

end;

if t>max then

begin

max:=t;

vtd:=i;

vtc:=j;

end;

i:=j+1;

end;

for i:=vtc downto vtd do

begin

inc(d1);

b[d1]:=a[i];

end;

for i:= k dowto 1 do

write(f,b[i],' ');

close(f);

end;

begin

ip;

out;

end.

7 tháng 4 2025

def generate_sequence(n):

"""Generates the sequence A up to the nth term."""


if n < 0:

return "Please enter a non-negative number."


sequence = [] # This list will hold our sequence


if n >= 0:

sequence.append(1) # A[0] = 1


if n >= 1:

sequence.append(3) # A[1] = 3


for i in range(2, n + 1):

# Calculate A[i] using the rule: A[i] = A[i-1] * 2 * A[i-2]

next_term = sequence[i - 1] * 2 * sequence[i - 2]

sequence.append(next_term)


return sequence


# Let's see the sequence up to the 5th term (A[0] to A[5])

result = generate_sequence(5)

print(result) # Output: [1, 3, 6, 36, 432, 31104]

5 tháng 11 2019

1:

uses crt;

var a,b,bt:real;

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

bt:=(sqr(a)+sqr(b))/2;

writeln('bieu thuc=',bt:4:2);

readln;

end.

2:

uses crt;

var s,v,t:integer;

begin

clrscr;

write('nhap thoi gian xe chay:'); readln(t);

write('nhap van toc cua xe:'); readln(v);

s:=v*t;

writeln('quang duong xe chay duoc la: ',s:4:2);

readln;

end.