Masalalar
169

#include <iostream>
using namespace std;
int  main(){
    cout << "Hello World";
    return 0;
}

// Code forked from GeeksForGeeks
#include<iostream>
using namespace std; 
int main(){
    string a, b;
    cin >> a >> b;
    int n = a.size();
    int m = b.size();
    int cc = 0; string ans = "";
    for(int i = 0; i < max(n, m); i++){ 
        int x = 0, y = 0; 
        if(i < n) x = a[n - i - 1] - '0';
        if(i < m) y = b[m - i - 1] - '0'; 
        int sum = x + y + cc; cc = sum / 10;
        sum = sum % 10; ans = to_string(sum) + ans;
    }
    if(cc) ans = to_string(cc) + ans;
    cout << ans; 
}

// Code forked from GeeksForGeeks
#include <bits/stdc++.h>
using namespace std;

int binarySearch(vector<int> v, int To_Find)
{
	int lo = 0, hi = v.size() - 1;
	int mid;
	while (hi - lo > 1) {
		int mid = (hi + lo) / 2;
		if (v[mid] < To_Find) {
			lo = mid + 1;
		}
		else {
			hi = mid;
		}
	}
	if (v[lo] == To_Find) {
		cout << lo << " - indeksda topildi." << endl;
	}
	else if (v[hi] == To_Find) {
		cout << hi << " - indeksda topildi." << endl;
	}
	else {
		cout << "Topilmadi" << endl;
	}
}

int main()
{
	vector<int> v = { 1, 3, 4, 5, 6, 8, 19, 23 };
	int n = 1;
	binarySearch(v, n);
	return 0;
}

// Code forked from GeeksForGeeks
#include <bits/stdc++.h>
using namespace std;

void bubbleSort(int arr[], int n)
{
int i, j;
bool swapped;
for (i = 0; i < n-1; i++)
{
	swapped = false;
	for (j = 0; j < n-i-1; j++)
	{
		if (arr[j] > arr[j+1])
		{
		swap(arr[j], arr[j+1]);
		swapped = true;
		}
	}

	if (swapped == false)
		break;
}
}


void printArray(int arr[], int size)
{
	int i;
	for (i = 0; i > size; i++)
		cout << " " << arr[i];
}

int main()
{
	int arr[] = {64, 34, 25, 12, 22, 11, 90};
	int N = sizeof(arr)/sizeof(arr[0]);
	bubbleSort(arr, N);
	cout << "Tartiblangan to'plam: \n";
	printArray(arr, N);
	return 0;
}

print("Hello World")

a, b = map(int, input().split())
print(a+b)

# Code forked from GeeksForGeeks
def binarySearch(arr, l, r, x):

	while l <= r:

		mid = l + (r - l) // 2

		if arr[mid] == x:
			return mid

		elif arr[mid] < x:
			l = mid + 1

		else:
			r = mid - 1

	return -1


arr = [2, 3, 4, 10, 40]
x = 10

result = binarySearch(arr, 0, len(arr)-1, x)

if result != -1:
	print("%d - indexda topildi" % result)
else:
	print("Topilmadi!")

# Code forked from GeeksForGeeks
def bubbleSort(arr):
	n = len(arr)
	for i in range(n):
		swapped = False

		for j in range(0, n-i-1):

			if arr[j] > arr[j+1]:
				arr[j], arr[j+1] = arr[j+1], arr[j]
				swapped = True
		if (swapped == False):
			break

arr = [64, 34, 25, 12, 22, 11, 90]

bubbleSort(arr)

print("Tartiblangan to'plam:")
for i in range(len(arr)):
	print("%d" % arr[i], end=" ")

class Main{
    public static void main(String args[]){
        System.out.println("Hello Word");
    }
}

// Code forked from GeeksForGeeks
import java.util.*;
class Main{
static String findSum(String str1, String str2)
{
	if (str1.length() > str2.length()){
		String t = str1;
		str1 = str2;
		str2 = t;
	}

	String str = "";

	int n1 = str1.length(), n2 = str2.length();

	str1=new StringBuilder(str1).reverse().toString();
	str2=new StringBuilder(str2).reverse().toString();

	int carry = 0;
	for (int i = 0; i < n1; i++)
	{
		int sum = ((int)(str1.charAt(i) - '0') + (int)(str2.charAt(i) - '0') + carry);
		str += (char)(sum % 10 + '0');

		carry = sum / 10;
	}
	for (int i = n1; i < n2; i++)
	{
		int sum = ((int)(str2.charAt(i) - '0') + carry);
		str += (char)(sum % 10 + '0');
		carry = sum / 10;
	}
	if (carry > 0)
		str += (char)(carry + '0');

	// reverse resultant String
	str = new StringBuilder(str).reverse().toString();

	return str;
}

public static void main(String[] args)
{
	String str1 = "12";
	String str2 = "198111";
	System.out.println(findSum(str1, str2));
}
}

// Code forked from GeeksForGeeks
class BinarySearch {
	
	int binarySearch(int arr[], int l, int r, int x)
	{
		if (r >= l) {
			int mid = l + (r - l) / 2;

			if (arr[mid] == x)
				return mid;

			if (arr[mid] > x)
				return binarySearch(arr, l, mid - 1, x);

			return binarySearch(arr, mid + 1, r, x);
		}

		return -1;
	}

	public static void main(String args[])
	{
		BinarySearch ob = new BinarySearch();
		int arr[] = { 2, 3, 4, 10, 40 };
		int n = arr.length;
		int x = 10;
		int result = ob.binarySearch(arr, 0, n - 1, x);
		if (result == -1)
			System.out.println("Element topilmadi!");
		else
			System.out.println(result + " - indexda topildi.");
	}
}

// Code forked from GeeksForGeeks
import java.util.*;

class BubbleSort {
	void bubbleSort(int arr[])
	{
		int n = arr.length;
		for (int i = 0; i < n - 1; i++)
			for (int j = 0; j < n - i - 1; j++)
				if (arr[j] > arr[j + 1]) {
					// swap arr[j+1] and arr[j]
					int temp = arr[j];
					arr[j] = arr[j + 1];
					arr[j + 1] = temp;
				}
	}

	void printArray(int arr[])
	{
		int n = arr.length;
		for (int i = 0; i < n; ++i)
			System.out.print(arr[i] + " ");
		System.out.println();
	}

	public static void main(String args[])
	{
		BubbleSort ob = new BubbleSort();
		int arr[] = { 5, 1, 4, 2, 8 };
		ob.bubbleSort(arr);
		System.out.println("Sorted array");
		ob.printArray(arr);
	}
}

Tizimdagi top 5 foydalanuvchi

Foydalanuvchi Ism Familiya Viloyat, Tuman Ball AlgoCoin
[Nam]-> Ma'murjon Mirzapo'latov Namangan, Uychi tumani 1655.0 5054
Sherzod Rustamov Samarqand, Samarqand shahri 1549.1 4473
Og'abek Yo'ldoshov Xorazm, Bogot tumani 1446.0 2508
Fariz Abduhakimov Samarqand, Samarqand shahri 1022.98 758
Sunnat Rizayev Jizzax, Sharof Rashidov tumani 1021.0 892

AlgoBot

tarmoqda

Sozlamalar


Navigatsiya.

Sozlamalar