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;
char st;
int main()
{
cin>>a>>b;
cout<<"Nhap phep tinh:"; cin>>st;
if (st=='+') cout<<a+b;
if (st=='-') cout<<a-b;
if (st=='*') cout<<a*b;
if (st=='/') cout<<a/b;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n,i,j;
cout<<"Nhap n="; cin>>n;
for (i=1; i<=n; i++)
{
for (j=i; j<=i+n-1; j++)
cout<<j<<" ";
cout<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n,i,j;
cout<<"Nhap n="; cin>>n;
for (i=1; i<=n; i++)
{
for (j=i; j<=i+n-1; j++)
cout<<j<<" ";
cout<<endl;
}
return 0;
}
```cpp
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
int n;
std::cout << "Enter the number of integers (n < 10^5): ";
std::cin >> n;
std::vector<int> numbers(n); std::cout << "Enter " << n << " integers: "; for (int i = 0; i < n; ++i) { std::cin >> numbers[i]; } int sumOfOdd = 0; for (int i = 0; i < n; ++i) { if (numbers[i] % 2 != 0) { sumOfOdd += numbers[i]; } } std::sort(numbers.begin(), numbers.end()); std::cout << "Sum of odd integers: " << sumOfOdd << std::endl; std::cout << "Sorted sequence: "; for (int i = 0; i < n; ++i) { std::cout << numbers[i] << " "; } std::cout << std::endl; return 0;
}
```
câu 1
Program Nguyen_to;
Var n,i:integer;
Function NT(n:integer):Boolean;
Var ok: Boolean;
i: integer;
Begin ok:=true;
for i:=2 to n-1 do if (n mod i)= 0 then ok:=ok and false;
if n < 2 then NT:=false else NT:=ok;
End;
Begin Write('Nhap n: ');
Readln(n); i:=n;
Repeat i:=i+1;
Until NT(i);
Write('So nguyen to nho nhat lon hon ',n, 'la: ',i);
Readln End.
câu 2
uses crt;
const so: set of char=['0','1','2','3','4','5','6','7','8','9'];
var a:array[1..100] of integer;
st,b:string;
c,l,i,n,j:integer;
s, Max: integer;
begin clrscr;
write('Nhap xau:');
readln(st);
l:=length(st);
i:=1;
n:=0;
repeat if (st[i] in so) then begin b:='';
repeat b:=b+st[i];
inc(i);
until (not(st[i] in so)) or (i>l);
inc(n);
val(b,a[n],c);
end;
inc(i);
until i>l;
Max:=a[1];
for i:=2 to n do If Max<A[i] Then Max:=A[i];
Writeln('Phan tu lon nhat cua mang:', Max);
readln;
end.
uses crt;
begin
clrscr;
writeln('12+20=',12+20);
writeln('chao cac ban minh la hoc sinh lop 9');
readln;
end.
cảm ơn nhiều lắm luôn nè