Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
RGB7001 - 2 тооны нийлбэр |
Өгөгдсөн бүхэл тооны нийлбэрийг ол.
Input
2 бүхэл тоо зайгаар тусгаарлагдан нэг мөрөнд өгөгдөнө.
Output
2 тооны нийлбэр.
Example
Input: 12 23 Output: 35
Нэмсэн: | Bataa |
Огноо: | 2011-01-15 |
Хугацааны хязгаарлалт: | 1s |
Эх кодын хэмжээний хязгаарлалт: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Програмчлалын хэлүүд: | ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE |
hide comments
|
||||||||||||||
2025-05-13 03:52:52
amraaaaaa |
||||||||||||||
2025-04-22 08:36:27
#include<stdio.h> int main() { int n, m, k; printf("massive hemjee: "); scanf("%d%d", &n, &m); printf("haih k oruul: "); scanf("%d", &k); int arr[n][m]; printf("massive element:\n"); for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { scanf("%d", &arr[i][j]); } } int count = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (arr[i][j] == k) { count++; } } } if (count > 0) { printf("toonii too: %d\n", count); } else { printf("NO\n"); } return 0; } |
||||||||||||||
2025-03-23 07:36:13
naadhaa huul puusyfdfssfdsfsfdsfkehdsiefhoazlhfhbzzfb fdihfbKHDSFLHfd dkdsFHFLJSEfSJDfheudhkljdfeidhfbdnfiebd fhsifsejhdllfhEIdhefhfyeyKf djdFdlfldfhldflksFkjdhdudeudujdhvlihdvluidvlvdHDLUKHDVKHcvhkj dhdhsLKHDLvsdBKLlSKDVJHlKSJlkSJDHVSLVBlvsKBHLDVHfdhvvxlJDKsKLHDlvsNDKsLDBVHafjbvDKLJVlKDJVbvjkcdlkjzsdldasfjkladfskjlsfdjhfskadjlfsfd sdfsdffk sdfdsfijlsajkfsdlafkh sdfkhlldfkdjshalkjfsdsdlkjf -sfkjasasdflkhahdbfasjlksfdjsak jfdkjdshaflsadfjkhlhkfsdlskfdhs khdskasdfjhalsfdhlsdhf ljasdfdfslkahsdfhkhsfda m thjgdfjkff fekwhgwufuwef hwfvwjfwujvf nwfuwfukwfhjnduxmeudfyhjcxnbeo8ucnhjx huewjmndscyudcn shu |
||||||||||||||
2025-02-13 06:27:22
#include <iostream> #include <string> #include <sstream> #include <vector> #include <stdexcept> // Function to read a line of input from the user std::string read_input() { std::string input_line; std::getline(std::cin, input_line); // Read the entire line from standard input return input_line; // Return the input string } // Function to split a string by spaces into individual components (in this case, integers) std::vector<std::string> split_input(const std::string& input_line) { std::vector<std::string> split_values; std::string temp; std::stringstream ss(input_line); // Convert the string into a stringstream for processing while (ss >> temp) { split_values.push_back(temp); // Store each split part of the input into the vector } return split_values; } // Function to convert a string to an integer and handle potential errors int string_to_int(const std::string& str) { int value; std::stringstream ss(str); if (!(ss >> value)) { // If conversion fails throw std::invalid_argument("Invalid integer input: " + str); } return value; // Return the integer value if conversion is successful } // Function to parse the two integers from the input string void parse_input(const std::string& input_line, int& num1, int& num2) { std::vector<std::string> split_values = split_input(input_line); // Step 1: Split the input if (split_values.size() != 2) { // Check if there are exactly two numbers throw std::invalid_argument("Expected exactly two integers, found: " + std::to_string(split_values.size())); } num1 = string_to_int(split_values[0]); // Convert the first string to an integer num2 = string_to_int(split_values[1]); // Convert the second string to an integer } // Function to calculate the sum of two integers int calculate_sum(int num1, int num2) { return num1 + num2; // Return the sum of the two integers } // Function to print the result of the sum void print_result(int result) { std::cout << result << std::endl; // Output the result } // Function to ensure the integrity of input and handle errors void handle_input_and_calculate_sum() { try { std::string input_line = read_input(); // Step 1: Read input int num1, num2; // Declare two integer variables parse_input(input_line, num1, num2); // Step 2: Parse the input and convert it to integers int result = calculate_sum(num1, num2); // Step 3: Calculate the sum of the two integers print_result(result); // Step 4: Output the result } catch (const std::exception& e) { std::cout << "Error: " << e.what() << std::endl; // Catch and print any errors that occurred } } int main() { handle_input_and_calculate_sum(); // Execute the full process in the main function return 0; // Return 0 to indicate that the program has successfully ended } Last edit: 2025-02-13 06:30:05 |
||||||||||||||
2025-02-05 08:20:08
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; int c=a+b; cout<<c; return 0; } |
||||||||||||||
2025-02-05 08:17:32
are you sure giga niggas |
||||||||||||||
2025-01-30 02:31:29
teneg ariungoo :3 |
||||||||||||||
2025-01-28 03:13:02
z Last edit: 2025-01-28 03:13:51 |
||||||||||||||
2025-01-17 06:54:25
#include <iostream> using namespace std; int main() { long long a,b,c,d,e,f,g=0,h=0,i,s=0,m,n,p=1,j,x[123456789123456789],y[123456789]; string k, l; cin>>k; for(i=0;i<k.size();i++){ if(k[i]=='0'){ g++; } else{ s++; s+=(g+1)/2; g=0; } } s+=(g+1)/2; cout<<s; return 0; } |
||||||||||||||
2025-01-17 06:31:31
nigga2x start mewing Last edit: 2025-01-17 06:54:35 |