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 main()
{
int m,n;
cin>>m>>n;
int k=m*n;
for (int i=1; i<=k; i++)
cout<<i<<" ";
return 0;
}
1. Uses crt;
var n,i: integer;
begin clrscr;
readln(n);
for i:=1 to n do write(i:3);
readln;
end.
2. Uses crt;
var n,i: integer;
begin clrscr;
readln(n);
for i:=1 to n do if(i mod 2 = 0) then write(i:3);
readln;
end.
c1:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) s=s*i;
cout<<s;
return 0;
}
Câu 2:
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) if (i%2==0) s=s*i;
cout<<s;
return 0;
}
program trungbinh;
uses crt;
var n,i: integer;
s:real;
A: array[1..1000] of integer;
begin
clrscr;
write('Nhap do dai day: '); readln(n);
writeln('Nhap gia tri cua day: ');
S:=0;
for i:=1 to n do
begin
write('A[',i,']= ');
readln(A[i]);
S:=S+A[i];
end;
S:=S/n;
write('Trung binh cua cac so cua day do la: ',S);
readln;
end.
program sum_of_naturals;
var
i, n, sum: integer;
begin
write('Enter a positive integer: ');
readln(n);
sum := 0;
for i := 1 to n do
begin
sum := sum + i;
end;
writeln('The sum of the first ', n, ' natural numbers is ', sum);
end.
#include <bits/stdc++.h>
using namespace std;
long long m,n;
int main()
{
cin>>m>>n;
cout<<m*n;
return 0;
}
Bài 2:
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin >>x>>y;
cout<<x<<" "<<y;
swap(x,y);
cout<<x<<" "<<y;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
int k=m*n;
for (int i=1; i<=k; i++)
cout<<i<<" ";
return 0;
}