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.

28 tháng 2 2022

= 5656000 nha

HT

:)))

28 tháng 2 2022

1000 x 5656 = 5656000

7 tháng 3 2017

Mk ko hiểu đề bài bn ạ?

#include <bits/stdc++.h>

using namespace std;

int n,i,t1=0,t2=0;

int main()

{

cin>>n;

for (int i=1; i<=n; i++)

{

if (i%2==0) t1+=i;

else t2+=i;

}

cout<<t1<<endl;

cout<<t2<<endl;

cout<<"hieu tuyet doi la:"<<abs(t2-t1);

}

24 tháng 11 2019

#include<bits/stdc++.h>

using namespace std;

int luythua(int x, int n){

return (n==0)?1:(x*luythua(x, n-1))%10000;

}

int main(){

int x, n;

cin>>x>>n;

cout<<luythua(x, n);

}

program uptowin; uses crt; const dong=5; tocdo=1000; var memory:array[1..dong]of word; vt:shortint;thua,Qexit:boolean;x,y,z:word;{x,y,z la bien nhap} dem,key:byte;c:char; {_} function wall(a:word;b:byte):boolean; begin b:=16-b; if odd(a shr (b)) then wall:=true else wall:=false; end; {_} procedure vekhung(x1,y1,x2,y2:word); var z,a,b:word; begin if (x1<>x2) and (y1<>y2) then begin a:=wherex; b:=wherey; if x1>x2 then begin z:=x1; x1:=x2; x2:=z; end; if y1>y2 then begin z:=y1; y1:=y2; y2:=z; end; ...
Đọc tiếp

program uptowin;
uses crt;
const dong=5; tocdo=1000;
var
memory:array[1..dong]of word;
vt:shortint;thua,Qexit:boolean;x,y,z:word;{x,y,z la bien nhap}
dem,key:byte;c:char;
{_}
function wall(a:word;b:byte):boolean;
begin
b:=16-b;
if odd(a shr (b)) then wall:=true
else wall:=false;
end;
{_}
procedure vekhung(x1,y1,x2,y2:word);
var z,a,b:word;
begin
if (x1<>x2) and (y1<>y2) then
begin
a:=wherex; b:=wherey;
if x1>x2 then
begin z:=x1; x1:=x2; x2:=z; end;
if y1>y2 then
begin z:=y1; y1:=y2; y2:=z; end;
gotoxy(x1,y1); write(#201);
if x2-x1>1 then for z:=1 to x2-x1-1 do write(#205);
gotoxy(x2,y1); write(#187);
gotoxy(x1,y2); write(#200);
if x2-x1>1 then for z:=1 to x2-x1-1 do write(#205);
gotoxy(x2,y2); write(#188);
if y2-y1>1 then for z:=1 to y2-y1-1 do begin
gotoxy(x1,z+y1); write(#186); end;
if y2-y1>1 then for z:=1 to y2-y1-1 do begin
gotoxy(x2,z+y1); write(#186); end;
end;
gotoxy(a,b);
end;
function rand:word;
var a:word;b,c:byte;
begin
b:=random(14)+1;
for c:=1 to b do
a:=a+ 1 shl (c-1);
a:=a shl random(14);
rand:=not a;
if (a=0) or (not a=0) then a:=rand;
end;
{_}
procedure run(x:boolean);
var e:byte;
{\}
procedure traiphai(var a:word);
var d:boolean;
begin
if odd(dem+e) then
begin
if a>maxint then
begin d:=true;
a:=a-maxint-1; end
else d:=false;
a:=a shl 1;
if d then a:=a+1;
if (wall(memory[1],vt)) then
vt:=vt-1;
end
else
begin
if odd(a) then
begin a:=a-1;
d:=true; end
else d:=false;
a:=a shr 1;
if d then a:=a+maxint+1;
if (wall(memory[1],vt)) then
vt:=vt+1;
end;
end;
{/}
begin
for e:=1 to dong do
if x and odd(e) then
traiphai(memory[e])
else if not x and not odd(e)then
traiphai(memory[e]);
end;
{_}
procedure draw;
var x,y:byte;
{\}
procedure help;
begin
textcolor(white);
vekhung(51,5,70,22);
vekhung(8,5,25,22);
textcolor(yellow);
gotoxy(54,8);write(' W : Up');
gotoxy(54,11);write(' A : Left');
gotoxy(54,14);write(' D : Right');
gotoxy(54,17);write(' Space : Pause');
gotoxy(54,20);write(' Esc : Exit');
vekhung(54,7,58,9);
vekhung(54,10,58,12);
vekhung(54,13,58,15);
vekhung(54,16,62,18);
vekhung(54,19,60,21);
gotoxy(9,6); write('Go up each floor');
gotoxy(9,7); write(', you will add 1');
gotoxy(9,8); write('bonus. But must');
gotoxy(9,9); write('not passing wall');
gotoxy(11,10); write('Example:');
gotoxy(11,12); write('Can''t go up:');
gotoxy(12,13);write(#219#32#219#219#32#219);
gotoxy(12,14);write(#205#205#205#205#205#205);
gotoxy(12,15);write(' ',#15,' ');
gotoxy(12,17);write('Can go up:');
gotoxy(12,18);write(#219#32#219#219#32#219);
gotoxy(12,19);write(#205#205#205#205#205#205);
gotoxy(12,20);write(' ',#15,' ');
end;
{/}
begin
clrscr;
textcolor(white);
vekhung(20,1,60,3);
gotoxy(30,2); write('*** GO UP TO WIN! ***');
vekhung(28,5,47,22);
textcolor(yellow);
gotoxy(30,7);
writeln(#205#205#205#205#205#205#205#205,
#205#205#205#205#205#205#205#205);
for x:=dong downto 1 do
begin
gotoxy(30,8+(dong-x)*2);
for y:=1 to 16 do
if memory[x] shl (y-1)>maxint-1 then write(#219)
else write(' ');
writeln;
gotoxy(30,8+(dong-x)*2+1);
writeln(#205#205#205,
#205#205#205#205#205#205#205,
#205#205#205#205#205#205);
end;
help;
gotoxy(30,20); write('Lines:',dem,' Key:',key,'/50');
gotoxy(vt+29,16); write(#15);
end;
procedure pause;
begin
clrscr;
vekhung(15,10,65,15);
gotoxy(18,13);
write(' Paused! Press any key to continue...');
readkey;
end;
procedure thuchon;
begin{+3}
c:=readkey;
case upcase(c) of{+4}
'D':if not wall(memory[1],vt+1) then vt:=vt+1;
'A':if not wall(memory[1],vt-1) then vt:=vt-1;
'W':if not wall(memory[2],vt) then begin{+5}
dem:=dem+1;
for z:= 1 to dong-1 do
memory[z]:=memory[z+1];
memory[dong]:=rand;
end;{-5}
' ': pause;
#27:begin
qexit:=true;
thua:=true;
end;
end;{-4}
if upcase(c) in['D','A','W'] then
begin key:=key+1; draw; end;
if key=50 then thua:=true;
end;{-3}

{____Main Program____}
begin
textbackground(blue); textcolor(yellow); clrscr;
randomize;
vekhung(15,10,65,15);
gotoxy(18,13);
write('Press any key to continue...');
repeat x:=random(1); until keypressed;
window(1,1,80,25);
repeat
key:=0;thua:=false;Qexit:=false;
vt:=8;x:=0;clrscr;
for x:=2 to dong do
memory[x]:=rand;
repeat{+0}
draw;
for x:=0 to 1000 do
begin{+1}
if x=0 then
run(true);
if x=500 then
run(false);
for y:=0 to tocdo do
begin{+2}
if keypressed then
thuchon;
if not (vt in[1..16]) then
begin thua:=true; break; end;
end;{-2}
end;{-1}
until thua;
gotoxy(1,4);
for x:= 1 to 80*21 do
begin write(' ');
for y:=1 to 1000 do
for z:=1 to 600 do; end;
textcolor(white);
vekhung(15,11,65,15);
gotoxy(30,11); write(' Infomation ');
textcolor(yellow);
gotoxy(19,12); write('Score: ',dem);
if not qexit then
write(' You are lost!');
gotoxy(19,13); write('Press Enter or Esc to quit!');
gotoxy(19,14); write('Press Space to replay!');
repeat c:=readkey; until c in [#27,#13,#32];
until c in [#27,#13];
end.

Trên là một chương trình game mình soạn trên Free Pascal nhưng không được. Lỗi thì không có rồi. Khi ấn Ctrl+F9 thì có dòng chữ "Press any key to continue", ấn xong thì bị thoát và có dòng chữ mới: "Program.... exited with exitcode = 201".

Ai phát hiện và tìm ra cách sửa lỗi thì báo mình nhé!!!

0
A.Phần trắc nghiệm Khoanh tròn vào câu đúng trong các câu sau : Câu1: Trong các tên sau đây, tên nào là hợp lệ trong ngôn ngữ lập trình Pascal: A. 8b; B. uses; C. bai tap; D. chuongtrinh; Câu2: Trong các chương trình Pascal sau đây , chương trình nào hợp lệ: A.begin end. B. begin Program baitap; writeln ('Chao cac ban'); end. C. begin D. Tất cả đều sai. Câu3: Ý nghĩa của câu lệnh X:=5 trong Pascal là: A. Gán giá trị số 5 vào biến nhớ X. B....
Đọc tiếp

A.Phần trắc nghiệm

Khoanh tròn vào câu đúng trong các câu sau :

Câu1: Trong các tên sau đây, tên nào là hợp lệ trong ngôn ngữ lập trình Pascal:

A. 8b; B. uses; C. bai tap; D. chuongtrinh;

Câu2: Trong các chương trình Pascal sau đây , chương trình nào hợp lệ:

A.begin end.

B. begin Program baitap; writeln ('Chao cac ban'); end.

C. begin

D. Tất cả đều sai.

Câu3: Ý nghĩa của câu lệnh X:=5 trong Pascal là:

A. Gán giá trị số 5 vào biến nhớ X. B. Cho biết giá trị của X là 5. C. Tăng giá trị của biến X lên 5 đơn vị. D. Tất cả đều đúng.

Câu5: Trong các câu lệnh pascal sau đây, câu nào đúng: A. if x: =3 then a:=b; B. if x = 6; then a:=b ; C. if x > 3 then x:=x+1 ; else x: x+2; D. if x > 3 then x:=x+1 else x:= x+2;

Câu 6: Phạm vi giá trị của kiểu số nguyên trong khoảng nào sau đây: A. -2^15 đến 2^15 - 1 B. 2,9 × 10^38 đến 1,7 × 10^38 C. -32768 đến 32768 D. Tất cả đều sai.

Câu7: Nếu cho X=8, giá trị của X là bao nhiêu sau câu lệnh: If (X mod 2)=0 then X:=X+2; A.8 B.9 C.10 D.11

Câu8:Nếu cho X=10, giá trị của X là bao nhiêu sau câu lệnh:If (X <=9) then X:X+1; A.8 B.10 C.9 D.11

Câu9: Trong Pascal,khai báo nào sau đây là đúng? A. Var tb: real; B. Var 4hs: integer C.Const x : real; D. Var R=30;

0
28 tháng 12 2021

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

sort(a+1,a+n+1);

for (i=n; i>=1; i--) cout<<a[i]<<" ";

return 0;

}