#savol_37
#javob_37
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean shox = ((x1 == x2 - 1) && (y1 == y2 + 1)) ||
((x1 == x2) && (y1 == y2 + 1)) ||
((x1 == x2 + 1) && (y1 == y2 + 1)) ||
((x1 == x2 - 1) && (y1 == y2)) ||
((x1 == x2 + 1) && (y1 == y2)) ||
((x1 == x2 - 1) && (y1 == y2 - 1)) ||
((x1 == x2) && (y1 == y2 - 1)) ||
((x1 == x2 + 1) && (y1 == y2 - 1));
System.out.println(shox);
}
Telegram | Viktorina bot | Youtube
#javob_37
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean shox = ((x1 == x2 - 1) && (y1 == y2 + 1)) ||
((x1 == x2) && (y1 == y2 + 1)) ||
((x1 == x2 + 1) && (y1 == y2 + 1)) ||
((x1 == x2 - 1) && (y1 == y2)) ||
((x1 == x2 + 1) && (y1 == y2)) ||
((x1 == x2 - 1) && (y1 == y2 - 1)) ||
((x1 == x2) && (y1 == y2 - 1)) ||
((x1 == x2 + 1) && (y1 == y2 - 1));
System.out.println(shox);
}
Telegram | Viktorina bot | Youtube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
❤3
#savol_cpp_integer_7
#javob_cpp_integer_7
#include <iostream>
using namespace std;
int main(){
int a, b, onlar, birlar, yigindisi;
cout << "a = ";
cin >> a;
onlar = a / 10;
birlar = a % 10;
yigindisi = onlar + birlar;
cout << "O'nliklar xonasidagi son = " << onlar << endl;
cout << "Birliklar xonasidagi son = " << birlar << endl;
cout << "Ularning yig'indisi = " << yigindisi;
}
Telegram | Viktorina bot | YouTube
#javob_cpp_integer_7
#include <iostream>
using namespace std;
int main(){
int a, b, onlar, birlar, yigindisi;
cout << "a = ";
cin >> a;
onlar = a / 10;
birlar = a % 10;
yigindisi = onlar + birlar;
cout << "O'nliklar xonasidagi son = " << onlar << endl;
cout << "Birliklar xonasidagi son = " << birlar << endl;
cout << "Ularning yig'indisi = " << yigindisi;
}
Telegram | Viktorina bot | YouTube
🤩4❤1🔥1🎉1
#savol_38
#javob_38
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean fil = ((Math.abs(x1 - x2)) == (Math.abs(y1 - y2)));
System.out.println(fil);
}
Telegram | Viktorina bot | Youtube
#javob_38
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean fil = ((Math.abs(x1 - x2)) == (Math.abs(y1 - y2)));
System.out.println(fil);
}
Telegram | Viktorina bot | Youtube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
❤2🔥1
#savol
Satr berilgan. Satrdagi eng qisqa so'z nechta harfdan iborat ekanligini topuvchi dastur tuzing?
#javob
C++ dasturlash tilida
#include <bits/stdc++.h>
using namespace std;
int main(){
string satr, c[50], z;
int k = 0;
cout << "Satr kiriting: ";
getline(cin, satr);
satr += " ";
for (int i = 0; i < satr.length(); i++){
if(satr[i] == ' '){
c[k++] = z;
z.clear();
}
else z += satr[i];
}
int min = c[0].length();
for (int i = 1; i < k; i++)
if (min > c[i].length())
min = c[i].length();
cout << "Eng qisqa so'z uzunligi " << min << " ta harfdan";
}
Telegram | Viktorina bot | YouTube
Satr berilgan. Satrdagi eng qisqa so'z nechta harfdan iborat ekanligini topuvchi dastur tuzing?
#javob
C++ dasturlash tilida
#include <bits/stdc++.h>
using namespace std;
int main(){
string satr, c[50], z;
int k = 0;
cout << "Satr kiriting: ";
getline(cin, satr);
satr += " ";
for (int i = 0; i < satr.length(); i++){
if(satr[i] == ' '){
c[k++] = z;
z.clear();
}
else z += satr[i];
}
int min = c[0].length();
for (int i = 1; i < k; i++)
if (min > c[i].length())
min = c[i].length();
cout << "Eng qisqa so'z uzunligi " << min << " ta harfdan";
}
Telegram | Viktorina bot | YouTube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
👍4❤1
#savol
Satr berilgan. Satrdagi eng uzun so'z nechta harfdan iborat ekanligini topuvchi dastur tuzing?
#javob
C++ dasturlash tilida
#include <bits/stdc++.h>
using namespace std;
int main(){
string satr, c[50], z;
int k = 0;
cout << "Satr kiriting: ";
getline(cin, satr);
satr += " ";
for (int i = 0; i < satr.length(); i++){
if(satr[i] == ' '){
c[k++] = z;
z.clear();
}
else z += satr[i];
}
int max = c[0].length();
for (int i = 1; i < k; i++)
if (max < c[i].length())
max = c[i].length();
cout << "Eng uzun so'z uzunligi " << max << " ta harfdan";
}
Telegram | Viktorina bot | YouTube
Satr berilgan. Satrdagi eng uzun so'z nechta harfdan iborat ekanligini topuvchi dastur tuzing?
#javob
C++ dasturlash tilida
#include <bits/stdc++.h>
using namespace std;
int main(){
string satr, c[50], z;
int k = 0;
cout << "Satr kiriting: ";
getline(cin, satr);
satr += " ";
for (int i = 0; i < satr.length(); i++){
if(satr[i] == ' '){
c[k++] = z;
z.clear();
}
else z += satr[i];
}
int max = c[0].length();
for (int i = 1; i < k; i++)
if (max < c[i].length())
max = c[i].length();
cout << "Eng uzun so'z uzunligi " << max << " ta harfdan";
}
Telegram | Viktorina bot | YouTube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
👍3❤2
#savol_39
#javob_39
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean farzin = (((Math.abs(x1 - x2)) == (Math.abs(y1 - y2))) ||
((x1 == x2) || (y1 == y2)));
System.out.println(farzin);
}
Telegram | Viktorina bot | Youtube
#javob_39
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean farzin = (((Math.abs(x1 - x2)) == (Math.abs(y1 - y2))) ||
((x1 == x2) || (y1 == y2)));
System.out.println(farzin);
}
Telegram | Viktorina bot | Youtube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
👍2🔥1
algo_4.docx
265.2 KB
Telegram botimiz
@BotProgrammersBot
Telegram guruhimiz
https://t.iss.one/Cpp_java_dasturlash
Telegram kanalimiz
https://t.iss.one/Programmers_Dasturchi
You tube kanalimiz
https://www.youtube.com/channel/UCY8_Bh0BdGBJxvnqSNT60fA
@BotProgrammersBot
Telegram guruhimiz
https://t.iss.one/Cpp_java_dasturlash
Telegram kanalimiz
https://t.iss.one/Programmers_Dasturchi
You tube kanalimiz
https://www.youtube.com/channel/UCY8_Bh0BdGBJxvnqSNT60fA
👍2🤩1
#savol_cpp_integer_8
#javob_cpp_integer_8
#include <iostream>
using namespace std;
int main(){
int a, b, onlar, birlar;
cout << "a = ";
cin >> a;
onlar = a / 10;
birlar = a % 10;
cout << "Natija = " << birlar << "" << onlar;
}
Telegram | Viktorina bot | YouTube
#javob_cpp_integer_8
#include <iostream>
using namespace std;
int main(){
int a, b, onlar, birlar;
cout << "a = ";
cin >> a;
onlar = a / 10;
birlar = a % 10;
cout << "Natija = " << birlar << "" << onlar;
}
Telegram | Viktorina bot | YouTube
👍2
#savol_40
#javob_40
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean ot = (((Math.abs(x1 - x2) == 1)) && (Math.abs(y1 - y2) == 2) ||
((Math.abs(x1 - x2) == 2)) && (Math.abs(y1 - y2) == 1));
System.out.println(ot);
}
Telegram | Viktorina bot | Youtube
#javob_40
Java dasturlash tilida
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("x1 = ");
int x1 = scanner.nextInt();
System.out.print("y1 = ");
int y1 = scanner.nextInt();
System.out.print("x2 = ");
int x2 = scanner.nextInt();
System.out.print("y2 = ");
int y2 = scanner.nextInt();
boolean ot = (((Math.abs(x1 - x2) == 1)) && (Math.abs(y1 - y2) == 2) ||
((Math.abs(x1 - x2) == 2)) && (Math.abs(y1 - y2) == 1));
System.out.println(ot);
}
Telegram | Viktorina bot | Youtube
Telegram
PROGRAMMERS
Guruh: @Cpp_java_dasturlash
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
Android: @prog_mz_android
Quiz bot: @programmersQuiz_bot
Portfolio: @ProgrammersPortfolio
Reklama: https://t.iss.one/programmers_reklama/2
Kanal uchun taklif:
@Mr_Max_Telegram
@ZohidAbdullayev
👍5
#savol_cpp_integer_9
#javob_cpp_integer_9
#include <iostream>
using namespace std;
int main(){
int n, s;
cout << "n = ";
cin >> n;
s = n / 100;
cout << "Yuzlar xonasidagi son = " << s;
}
Telegram | Viktorina bot | YouTube
#javob_cpp_integer_9
#include <iostream>
using namespace std;
int main(){
int n, s;
cout << "n = ";
cin >> n;
s = n / 100;
cout << "Yuzlar xonasidagi son = " << s;
}
Telegram | Viktorina bot | YouTube
👍6