Бодолт илгээх | Бүх бодолтууд | Шилдэг бодолтууд | Жагсаалт руу буцах |
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-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 |
||||||||||||||
2024-12-17 04:42:26
CREATE TABLE movies ( id INT PRIMARY KEY, movie_title VARCHAR(255), imdb_rating DECIMAL(3,1), year_released INT, budget DECIMAL(10,2), box_office DECIMAL(10,2), distribution_company_id INT, language VARCHAR(255) ); INSERT INTO movies (id, movie_title, imdb_rating, year_released, budget, box_office, distribution_company_id, language) VALUES (1, 'The Shawshank Redemption', 9.2, 1994, 25.00, 73.30, 1, 'English'), (2, 'The Godfather', 9.2, 1972, 7.20, 291.00, 2, 'English'), (3, 'The Dark Knight', 9.0, 2008, 185.00, 1006.00, 3, 'English'), (4, 'The Godfather Part II', 9.0, 1974, 13.00, 93.00, 2, 'English, Sicilian'), (5, '12 Angry Men', 9.0, 1957, 0.34, 2.00, 4, 'English'), (6, 'Schindler\'s List', 8.9, 1993, 22.00, 322.20, 5, 'English, German, Yiddish'), (7, 'The Lord of the Rings: The Return of the King', 8.9, 2003, 94.00, 1146.00, 6, 'English'), (8, 'Pulp Fiction', 8.8, 1994, 8.50, 213.90, 7, 'English'), (9, 'The Lord of the Rings: The Fellowship of the Ring', 8.8, 2001, 93.00, 898.20, 6, 'English'), (10, 'The Good, the Bad and the Ugly', 8.8, 1966, 1.20, 38.90, 8, 'English, Italian, Spanish'); CREATE TABLE distribution_companies ( id INT PRIMARY KEY, company_name VARCHAR(255) ); INSERT INTO distribution_companies (id, company_name) VALUES (1, 'Columbia Pictures'), (2, 'Paramount Pictures'), (3, 'Warner Bros. Pictures'), (4, 'United Artists'), (5, 'Universal Pictures'), (6, 'New Line Cinema'), (7, 'Miramax Films'), (8, 'Produzioni Europee Associate'), (9, 'Buena Vista'), (10, 'StudioCanal'); |