Bài tập lập trình
Tên bài tập | Danh mục | Phạm vi | Sắp xếp | Ngày cập nhật | |
---|---|---|---|---|---|
Pre: {{ _myProblem.Problem.Info.DependencyProblemName }}
{{ _myProblem.Problem.Info.Name }}
{{_myProblem.Problem.BusinessKey}}
{{ _myProblem.Problem.Info.ProgrammingLanguage }} |
{{ _myProblem.SubTopic.Info.TopicName }}
{{ _myProblem.SubTopic.Info.Name }}
|
{{ LookupFindByCode('Scope', _myProblem.Problem.Info.Scope) }} {{ LookupFindByCode('Scope', _myProblem.Problem.Info.Scope) }} {{ LookupFindByCode('Scope', _myProblem.Problem.Info.Scope) }} | {{ _myProblem.Problem.Info.OrderNumber }} | {{ UTCToLocal(_myProblem.Problem.LastUpdate) }} |
Trang {{dashboardFilter.PageNumber}}
Xem chi tiết
Hãy đóng vai trò là Chuyên gia Đánh giá Kỹ thuật và Tinh chỉnh Đề Lập trình. Nhiệm vụ của bạn là kiểm tra, đánh giá và tinh chỉnh toàn diện đề thi lập trình này theo các bước sau: 1. Tinh chỉnh Đề bài & Xuất HTML: * Kiểm tra văn phong, cấu trúc, và tính nghiêm túc của đề bài (Phần 1). * Sau khi tinh chỉnh, RÁP NỘI DUNG VÀO TEMPLATE HTML MẪU (Phần 4) để tạo ra đề bài cuối cùng. * Chuẩn hóa ký hiệu toán học (ví dụ: dùng 1 <= N <= 10^5). * xuất HTML đề bài trong một block code duy nhất 2. Phân tích Testcase: * Xác nhận tính chính xác của các Testcase Mẫu (Phần 3). * Đánh giá tính bao quát, mức độ khó và sự bao phủ các trường hợp biên của 10 Testcase Ẩn (Phần 4). 3. Đánh giá Template Code: * Phân tích tính chính xác, hiệu suất I/O, và an toàn kỹ thuật của 4 Template Code (Phần 2a-2d). * **YÊU CẦU QUAN TRỌNG VỀ TEMPLATE:** 1. Hàm xử lý phải có dòng trả về cuối cùng là giá trị mặc định, kèm theo chú thích rõ ràng: // <-- Thay bằng kết quả đúng.* Báo cáo đầu ra cần có các phần: * Phiên bản HTML Đề Bài Đã Ráp Nội dung (Dùng Template Mẫu). * Phân tích chi tiết về các điểm cần tinh chỉnh trong đề bài (nếu có). * Xác nhận tính chính xác của Testcase Mẫu. * Đánh giá chuyên sâu về từng Template Code (C#, C++, Java, Python). * **Cung cấp toàn bộ Source Code của 4 Template (C#, C++, Java, Python)** đã được điều chỉnh và hoàn thiện. Nhớ sử dụng các comment rõ nghĩa như template hiện có * Đánh giá tính bao quát của 10 Testcase Ẩn. * Cung cấp danh sách 10 Testcase Ẩn Đã Chỉnh Sửa (Input và Output Chính xác) để sử dụng cho bộ test chính thức. --- CÚ PHÁP KHI CUNG CẤP DỮ LIỆU --- [PHẦN 1: ĐỀ BÀI (Văn bản thuần)] {{myProblem.Problem.Info.Description}} --- [PHẦN 2: CÁC TEMPLATE CODE] [2a: Template C#] {{myProblem.Problem.Info.TemplateCodeCSharp}} [2b: Template C++] {{myProblem.Problem.Info.TemplateCodeCPlusPlus}} [2c: Template Java] {{myProblem.Problem.Info.TemplateCodeJava}} [2d: Template Python] {{myProblem.Problem.Info.TemplateCodePython}} --- [PHẦN 3: 10 TESTCASE ẨN] Testcase1: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput1}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected1}} Testcase2: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput2}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected2}} Testcase3: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput3}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected3}} Testcase4: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput4}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected4}} Testcase5: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput5}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected5}} Testcase6: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput6}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected6}} Testcase7: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput7}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected7}} Testcase8: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput8}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected8}} Testcase9: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput9}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected9}} Testcase10: Input: {{myProblem.Problem.TestCase.TestCaseConsoleInput10}} Output: {{myProblem.Problem.TestCase.TestCaseConsoleOutputExpected10}} --- [PHẦN 4: TEMPLATE HTML MẪU (SỬ DỤNG CHO OUTPUT)] <p>[MO_TA_BAI_TOAN]</p> <b>Yêu cầu:</b><p></p> <ol> <li>[YEU_CAU_1]</li> <li>[YEU_CAU_2]</li> <li>[YEU_CAU_3]</li> </ol> <b>Đầu vào:</b><p></p> <p>[MIEU_TA_DAU_VAO]</p> <pre> [INPUT_FORMAT] </pre> <b>Đầu ra:</b><p></p> <p>[MIEU_TA_DAU_RA]</p> <pre> [OUTPUT_FORMAT] </pre> <b>Ví dụ:</b><p></p> <table class="table table-centered table-bordered table-sm" style="max-width: 800px;"> <thead class="table-secondary"> <tr> <td> Input (đầu vào)</td> <td> Output (đầu ra)</td> <td> Giải thích</td> </tr> </thead> <tbody> [VI_DU_TESTCASE] </tbody> </table> <p></p> <b>Ràng buộc:</b><p></p> <ul> <li>[RANG_BUOC_1]</li> <li>[RANG_BUOC_2]</li> <li>[RANG_BUOC_3]</li> </ul> <p></p> <b>Hàm cần hoàn thành:</b><p></p> <p>Hoàn thành hàm <code>[TEN_HAM]</code> với các tham số:</p> <ul> [THAM_SO_HAM] </ul> Trả về:<p></p> <ul> <li><code>[KIEU_TRA_VE]</code>: [MIEU_TA_GIA_TRI_TRA_VE]</li> </ul>
Tạo mới
Cập nhật
Xóa
Are you sure to delete this item?
{{ myProblem.Problem.BusinessKey }}
Hướng dẫn
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
// ================= USER CODE =================
static void Solve1()
{
// === Kiểu nhập: 3 số nguyên trên 1 dòng ===
int a, b, c;
var parts = Console.ReadLine().Split();
a = int.Parse(parts[0]);
b = int.Parse(parts[1]);
c = int.Parse(parts[2]);
// Testcase Input: "1 2 3\n"
// Testcase Input Display On Screen:
// 1 2 3
// Testcase Expected: 3
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(Math.Max(a, Math.Max(b, c)));
}
static void Solve2()
{
// === Kiểu nhập: n số nguyên trong 1 dòng ===
int n = int.Parse(Console.ReadLine());
int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
// Testcase Input: "5\n1 3 5 2 4\n"
// Testcase Input Display On Screen:
// 5
// 1 3 5 2 4
// Testcase Expected: 5
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(arr.Max());
}
static void Solve3()
{
// === Kiểu nhập: ma trận n x m số nguyên ===
var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n = nm[0], m = nm[1];
int[,] mat = new int[n, m];
for (int i = 0; i < n; i++)
{
var row = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int j = 0; j < m; j++) mat[i, j] = row[j];
}
// Testcase Input: "2 2\n1 2\n3 4\n"
// Testcase Input Display On Screen:
// 2 2
// 1 2
// 3 4
// Testcase Expected: 4
// TODO: Logic xử lý ở đây và in ra kết quả
int maxVal = int.MinValue;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
if (mat[i, j] > maxVal) maxVal = mat[i, j];
Console.WriteLine(maxVal);
}
static void Solve4()
{
// === Kiểu nhập: nhiều dòng input, mỗi dòng 1 số ===
int n = int.Parse(Console.ReadLine());
int last = 0;
for (int i = 0; i < n; i++)
last = int.Parse(Console.ReadLine());
// Testcase Input: "3\n10\n20\n30\n"
// Testcase Input Display On Screen:
// 3
// 10
// 20
// 30
// Testcase Expected: 30
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(last);
}
static void Solve5()
{
// === Kiểu nhập: string 1 từ ===
string s = Console.ReadLine().Trim();
// Testcase Input: "hello\n"
// Testcase Input Display On Screen:
// hello
// Testcase Expected: hello
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(s);
}
static void Solve6()
{
// === Kiểu nhập: string cả dòng ===
string line = Console.ReadLine();
// Testcase Input: "this is a line\n"
// Testcase Input Display On Screen:
// this is a line
// Testcase Expected: this is a line
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(line);
}
static void Solve7()
{
// === Kiểu nhập: float/double 2 số ===
var parts = Console.ReadLine().Split();
double x = double.Parse(parts[0]);
double y = double.Parse(parts[1]);
// Testcase Input: "3.5 7.2\n"
// Testcase Input Display On Screen:
// 3.5 7.2
// Testcase Expected: 7.2
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(Math.Max(x, y));
}
static void Solve8()
{
// === Kiểu nhập: ký tự ===
char c = (char)Console.Read();
Console.ReadLine(); // clear newline
// Testcase Input: "a\n"
// Testcase Input Display On Screen:
// a
// Testcase Expected: a
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(c);
}
static void Solve9()
{
// === Kiểu nhập: boolean (1 hoặc 0) ===
bool flag = Console.ReadLine().Trim() == "1";
// Testcase Input: "1\n"
// Testcase Input Display On Screen:
// 1
// Testcase Expected: 1
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(flag ? 1 : 0);
}
static void Solve10()
{
// === Kiểu nhập: vector<string> 1 dòng ===
int n = int.Parse(Console.ReadLine());
string[] words = Console.ReadLine().Split();
// Testcase Input: "3\none two three\n"
// Testcase Input Display On Screen:
// 3
// one two three
// Testcase Expected: three
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(words.Last());
}
static void Solve11()
{
// === Kiểu nhập: vector 2D string ===
var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n = nm[0], m = nm[1];
string[,] mat = new string[n, m];
for (int i = 0; i < n; i++)
{
var row = Console.ReadLine().Split();
for (int j = 0; j < m; j++) mat[i, j] = row[j];
}
// Testcase Input: "2 2\nhi hello\nbye world\n"
// Testcase Input Display On Screen:
// 2 2
// hi hello
// bye world
// Testcase Expected: world
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(mat[n - 1, m - 1]);
}
static void Solve12()
{
// === Kiểu nhập: nhiều test case trong 1 dòng ===
int T = int.Parse(Console.ReadLine());
for (int t = 0; t < T; t++)
{
var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
int a = ab[0], b = ab[1];
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(a + b);
}
// Testcase Input: "2\n1 2\n3 4\n"
// Testcase Input Display On Screen:
// 2
// 1 2
// 3 4
// Testcase Expected: 3 7 (tùy logic)
}
static void Solve13()
{
// === Kiểu nhập: nhập đến EOF ===
string line;
int last = 0;
while ((line = Console.ReadLine()) != null)
{
last = int.Parse(line);
}
// Testcase Input: "10\n20\n30\n"
// Testcase Input Display On Screen:
// 10
// 20
// 30
// Testcase Expected: 30
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(last);
}
static void Solve14()
{
// === Kiểu nhập: vector nhiều dòng, số lượng không biết trước ===
List<int> a = new List<int>();
string line;
while ((line = Console.ReadLine()) != null && line != "")
{
a.Add(int.Parse(line));
}
// Testcase Input: "1\n2\n3\n4\n"
// Testcase Input Display On Screen:
// 1
// 2
// 3
// 4
// Testcase Expected: 4
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(a.Last());
}
static void Solve15()
{
// === Kiểu nhập: vector<string> nhiều dòng ===
int n = int.Parse(Console.ReadLine());
string[] vs = new string[n];
for (int i = 0; i < n; i++) vs[i] = Console.ReadLine();
// Testcase Input: "2\nhello\nworld\n"
// Testcase Input Display On Screen:
// 2
// hello
// world
// Testcase Expected: world
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(vs.Last());
}
static void Solve16()
{
// === Kiểu nhập: ma trận ký tự n x m ===
var nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n = nm[0], m = nm[1];
char[,] grid = new char[n, m];
for (int i = 0; i < n; i++)
{
var row = Console.ReadLine().Split();
for (int j = 0; j < m; j++) grid[i, j] = row[j][0];
}
// Testcase Input: "2 3\na b c\nd e f\n"
// Testcase Input Display On Screen:
// 2 3
// a b c
// d e f
// Testcase Expected: f
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(grid[n - 1, m - 1]);
}
static void Solve17()
{
// === Kiểu nhập: vector lớn, multi-line input ===
List<int> a = new List<int>();
string line;
while ((line = Console.ReadLine()) != null && line != "")
{
a.Add(int.Parse(line));
}
// Testcase Input: "1\n2\n3\n4\n5\n"
// Testcase Input Display On Screen:
// 1
// 2
// 3
// 4
// 5
// Testcase Expected: 5
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine(a.Last());
}
static void Solve18()
{
// === Kiểu nhập: 2 ma trận n1xm1 và n2xm2 ===
var nm1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n1 = nm1[0], m1 = nm1[1];
int[,] mat1 = new int[n1, m1];
for (int i = 0; i < n1; i++)
{
var row = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int j = 0; j < m1; j++) mat1[i, j] = row[j];
}
var nm2 = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n2 = nm2[0], m2 = nm2[1];
int[,] mat2 = new int[n2, m2];
for (int i = 0; i < n2; i++)
{
var row = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int j = 0; j < m2; j++) mat2[i, j] = row[j];
}
// Testcase Input: "2 2\n1 2\n3 4\n2 3\n5 6 7\n8 9 10\n"
// Testcase Input Display On Screen:
// 2 2
// 1 2
// 3 4
// 2 3
// 5 6 7
// 8 9 10
// Testcase Expected: Sum từng hàng
// TODO: Logic xử lý ở đây và in ra kết quả
Console.WriteLine("Sum of mat1:");
for (int i = 0; i < n1; i++)
{
int rowSum = 0;
for (int j = 0; j < m1; j++) rowSum += mat1[i, j];
Console.WriteLine(rowSum);
}
Console.WriteLine("Sum of mat2:");
for (int i = 0; i < n2; i++)
{
int rowSum = 0;
for (int j = 0; j < m2; j++) rowSum += mat2[i, j];
Console.WriteLine(rowSum);
}
}
// ================= MAIN WRAPPER =================
static void Main()
{
// Gọi từng Solve theo testcase bạn muốn
Solve1();
// Solve2();
// ...
// Solve18();
}
}
#include <bits/stdc++.h>
using namespace std;
// ================= USER CODE =================
void Solve1() {
// 1. 3 số nguyên trên 1 dòng
int a, b, c;
cin >> a >> b >> c;
// Testcase Input: "1 2 3\n"
// Testcase Input Display On Screen:
// 1 2 3
// Testcase Expected: 3
// TODO: Logic xử lý ở đây và in ra kết quả
cout << max({a, b, c}) << "\n";
}
void Solve2() {
// 2. n số nguyên trong 1 dòng
int n; cin >> n;
vector<int> arr(n);
for(int i = 0; i < n; i++) cin >> arr[i];
// Testcase Input: "5\n1 3 5 2 4\n"
// Testcase Input Display On Screen:
// 5
// 1 3 5 2 4
// Testcase Expected: 5
cout << *max_element(arr.begin(), arr.end()) << "\n";
}
void Solve3() {
// 3. ma trận n x m số nguyên
int n, m;
cin >> n >> m;
vector<vector<int>> mat(n, vector<int>(m));
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
cin >> mat[i][j];
// Testcase Input: "2 2\n1 2\n3 4\n"
// Testcase Input Display On Screen:
// 2 2
// 1 2
// 3 4
// Testcase Expected: 4
int maxVal = INT_MIN;
for(auto &row: mat)
for(int val: row)
maxVal = max(maxVal, val);
cout << maxVal << "\n";
}
void Solve4() {
// 4. nhiều dòng input, mỗi dòng 1 số
int n, last; cin >> n;
for(int i=0;i<n;i++) cin >> last;
// Testcase Input: "3\n10\n20\n30\n"
// Testcase Input Display On Screen:
// 3
// 10
// 20
// 30
// Testcase Expected: 30
cout << last << "\n";
}
void Solve5() {
// 5. string 1 từ
string s; cin >> s;
// Testcase Input: "hello\n"
// Testcase Input Display On Screen:
// hello
// Testcase Expected: hello
cout << s << "\n";
}
void Solve6() {
// 6. string cả dòng
string line;
getline(cin >> ws, line);
// Testcase Input: "this is a line\n"
// Testcase Input Display On Screen:
// this is a line
// Testcase Expected: this is a line
cout << line << "\n";
}
void Solve7() {
// 7. float/double 2 số
double x, y; cin >> x >> y;
// Testcase Input: "3.5 7.2\n"
// Testcase Input Display On Screen:
// 3.5 7.2
// Testcase Expected: 7.2
cout << max(x, y) << "\n";
}
void Solve8() {
// 8. ký tự
char c; cin >> c;
// Testcase Input: "a\n"
// Testcase Input Display On Screen:
// a
// Testcase Expected: a
cout << c << "\n";
}
void Solve9() {
// 9. boolean 1 hoặc 0
int flag; cin >> flag;
// Testcase Input: "1\n"
// Testcase Input Display On Screen:
// 1
// Testcase Expected: 1
cout << flag << "\n";
}
void Solve10() {
// 10. vector<string> trong 1 dòng
int n; cin >> n;
vector<string> words(n);
for(int i=0;i<n;i++) cin >> words[i];
// Testcase Input: "3\none two three\n"
// Testcase Input Display On Screen:
// 3
// one two three
// Testcase Expected: three
cout << words.back() << "\n";
}
void Solve11() {
// 11. vector 2D string
int n, m;
cin >> n >> m;
vector<vector<string>> mat(n, vector<string>(m));
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
cin >> mat[i][j];
// Testcase Input: "2 2\nhi hello\nbye world\n"
// Testcase Input Display On Screen:
// 2 2
// hi hello
// bye world
// Testcase Expected: world
cout << mat[n-1][m-1] << "\n";
}
void Solve12() {
// 12. nhiều test case trong 1 dòng
int T; cin >> T;
for(int t=0;t<T;t++){
int a,b; cin >> a >> b;
// Testcase Input: "2\n1 2\n3 4\n"
// Testcase Input Display On Screen:
// 2
// 1 2
// 3 4
// Testcase Expected: 3 7 (tùy logic)
// TODO: Logic xử lý ở đây và in ra kết quả
cout << a+b << "\n";
}
}
void Solve13() {
// 13. nhập đến EOF
int last = 0, x;
while(cin >> x) last = x;
// Testcase Input: "10\n20\n30\n"
// Testcase Input Display On Screen:
// 10
// 20
// 30
// Testcase Expected: 30
cout << last << "\n";
}
void Solve14() {
// 14. vector dài nhiều dòng, số lượng không biết trước
vector<int> a; int x;
while(cin >> x) a.push_back(x);
// Testcase Input: "1\n2\n3\n4\n"
// Testcase Input Display On Screen:
// 1
// 2
// 3
// 4
// Testcase Expected: 4
cout << a.back() << "\n";
}
void Solve15() {
// 15. vector<string> nhiều dòng
int n; cin >> n;
vector<string> vs(n);
for(int i=0;i<n;i++) cin >> vs[i];
// Testcase Input: "2\nhello\nworld\n"
// Testcase Input Display On Screen:
// 2
// hello
// world
// Testcase Expected: world
cout << vs.back() << "\n";
}
void Solve16() {
// 16. ma trận ký tự n x m
int n, m; cin >> n >> m;
vector<vector<char>> grid(n, vector<char>(m));
for(int i=0;i<n;i++)
for(int j=0;j<m;j++){
string s; cin >> s;
grid[i][j] = s[0];
}
// Testcase Input: "2 3\na b c\nd e f\n"
// Testcase Input Display On Screen:
// 2 3
// a b c
// d e f
// Testcase Expected: f
cout << grid[n-1][m-1] << "\n";
}
void Solve17() {
// 17. vector lớn không biết trước số lượng (multi-line input)
vector<int> a; int x;
while(cin >> x) a.push_back(x);
// Testcase Input: "1\n2\n3\n4\n5\n"
// Testcase Input Display On Screen:
// 1
// 2
// 3
// 4
// 5
// Testcase Expected: 5
cout << a.back() << "\n";
}
void Solve18() {
// 18. 2 ma trận n1xm1 và n2xm2
int n1,m1; cin >> n1 >> m1;
vector<vector<int>> mat1(n1, vector<int>(m1));
for(int i=0;i<n1;i++)
for(int j=0;j<m1;j++) cin >> mat1[i][j];
int n2,m2; cin >> n2 >> m2;
vector<vector<int>> mat2(n2, vector<int>(m2));
for(int i=0;i<n2;i++)
for(int j=0;j<m2;j++) cin >> mat2[i][j];
// Testcase Input: "2 2\n1 2\n3 4\n2 3\n5 6 7\n8 9 10\n"
// Testcase Input Display On Screen:
// 2 2
// 1 2
// 3 4
// 2 3
// 5 6 7
// 8 9 10
// Testcase Expected: in tổng từng hàng
cout << "Sum of mat1:\n";
for(int i=0;i<n1;i++){
int sum = 0;
for(int j=0;j<m1;j++) sum += mat1[i][j];
cout << sum << "\n";
}
cout << "Sum of mat2:\n";
for(int i=0;i<n2;i++){
int sum = 0;
for(int j=0;j<m2;j++) sum += mat2[i][j];
cout << sum << "\n";
}
}
// ================= MAIN WRAPPER =================
int main() {
Solve1();
// Solve2();
// Solve3();
// ...
// Solve18();
return 0;
}
import java.util.*;
import java.io.*;
public class Template18Java {
static void Solve1(Scanner sc){
// 1. 3 số nguyên trên 1 dòng
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
// Testcase Input: "1 2 3\n"
// Testcase Input Display On Screen:
// 1 2 3
// Testcase Expected: 3
// TODO: Logic xử lý ở đây và in ra kết quả
System.out.println(Math.max(a, Math.max(b, c)));
}
static void Solve2(Scanner sc){
// 2. n số nguyên trong 1 dòng
int n = sc.nextInt();
int[] arr = new int[n];
for(int i=0;i<n;i++) arr[i] = sc.nextInt();
// Testcase Input: "5\n1 3 5 2 4\n"
// Testcase Input Display On Screen:
// 5
// 1 3 5 2 4
// Testcase Expected: 5
int maxVal = Arrays.stream(arr).max().getAsInt();
System.out.println(maxVal);
}
static void Solve3(Scanner sc){
// 3. ma trận n x m số nguyên
int n = sc.nextInt();
int m = sc.nextInt();
int[][] mat = new int[n][m];
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
mat[i][j] = sc.nextInt();
// Testcase Input: "2 2\n1 2\n3 4\n"
// Testcase Input Display On Screen:
// 2 2
// 1 2
// 3 4
// Testcase Expected: 4
int maxVal = Integer.MIN_VALUE;
for(int[] row: mat)
for(int val: row)
maxVal = Math.max(maxVal, val);
System.out.println(maxVal);
}
static void Solve4(Scanner sc){
// 4. nhiều dòng input, mỗi dòng 1 số
int n = sc.nextInt();
int last = 0;
for(int i=0;i<n;i++) last = sc.nextInt();
// Testcase Input: "3\n10\n20\n30\n"
// Testcase Input Display On Screen:
// 3
// 10
// 20
// 30
// Testcase Expected: 30
System.out.println(last);
}
static void Solve5(Scanner sc){
// 5. string 1 từ
String s = sc.next();
// Testcase Input: "hello\n"
// Testcase Input Display On Screen:
// hello
// Testcase Expected: hello
System.out.println(s);
}
static void Solve6(Scanner sc){
// 6. string cả dòng
sc.nextLine();
String line = sc.nextLine();
// Testcase Input: "this is a line\n"
// Testcase Input Display On Screen:
// this is a line
// Testcase Expected: this is a line
System.out.println(line);
}
static void Solve7(Scanner sc){
// 7. float/double
double x = sc.nextDouble();
double y = sc.nextDouble();
// Testcase Input: "3.5 7.2\n"
// Testcase Input Display On Screen:
// 3.5 7.2
// Testcase Expected: 7.2
System.out.println(Math.max(x,y));
}
static void Solve8(Scanner sc){
// 8. ký tự
char c = sc.next().charAt(0);
// Testcase Input: "a\n"
// Testcase Input Display On Screen:
// a
// Testcase Expected: a
System.out.println(c);
}
static void Solve9(Scanner sc){
// 9. boolean
int flag = sc.nextInt();
// Testcase Input: "1\n"
// Testcase Input Display On Screen:
// 1
// Testcase Expected: 1
System.out.println(flag);
}
static void Solve10(Scanner sc){
// 10. vector<string> trong 1 dòng
int n = sc.nextInt();
String[] words = new String[n];
for(int i=0;i<n;i++) words[i] = sc.next();
// Testcase Input: "3\none two three\n"
// Testcase Input Display On Screen:
// 3
// one two three
// Testcase Expected: three
System.out.println(words[n-1]);
}
static void Solve11(Scanner sc){
// 11. vector 2D string
int n = sc.nextInt();
int m = sc.nextInt();
String[][] mat = new String[n][m];
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
mat[i][j] = sc.next();
// Testcase Input: "2 2\nhi hello\nbye world\n"
// Testcase Input Display On Screen:
// 2 2
// hi hello
// bye world
// Testcase Expected: world
System.out.println(mat[n-1][m-1]);
}
static void Solve12(Scanner sc){
// 12. nhiều test case trong 1 dòng
int T = sc.nextInt();
for(int t=0;t<T;t++){
int a = sc.nextInt();
int b = sc.nextInt();
// TODO: Logic xử lý ở đây và in ra kết quả
System.out.println(a+b);
}
}
static void Solve13(Scanner sc){
// 13. nhập đến EOF
int last = 0;
while(sc.hasNextInt()) last = sc.nextInt();
System.out.println(last);
}
static void Solve14(Scanner sc){
// 14. vector dài nhiều dòng, số lượng không biết trước
List<Integer> a = new ArrayList<>();
while(sc.hasNextInt()) a.add(sc.nextInt());
System.out.println(a.get(a.size()-1));
}
static void Solve15(Scanner sc){
// 15. vector<string> nhiều dòng
int n = sc.nextInt();
String[] vs = new String[n];
for(int i=0;i<n;i++) vs[i] = sc.next();
System.out.println(vs[n-1]);
}
static void Solve16(Scanner sc){
// 16. ma trận ký tự n x m
int n = sc.nextInt();
int m = sc.nextInt();
char[][] grid = new char[n][m];
for(int i=0;i<n;i++)
for(int j=0;j<m;j++){
String s = sc.next();
grid[i][j] = s.charAt(0);
}
System.out.println(grid[n-1][m-1]);
}
static void Solve17(Scanner sc){
// 17. vector lớn không biết trước số lượng
List<Integer> a = new ArrayList<>();
while(sc.hasNextInt()) a.add(sc.nextInt());
System.out.println(a.get(a.size()-1));
}
static void Solve18(Scanner sc){
// 18. 2 ma trận
int n1=sc.nextInt(), m1=sc.nextInt();
int[][] mat1 = new int[n1][m1];
for(int i=0;i<n1;i++)
for(int j=0;j<m1;j++)
mat1[i][j] = sc.nextInt();
int n2=sc.nextInt(), m2=sc.nextInt();
int[][] mat2 = new int[n2][m2];
for(int i=0;i<n2;i++)
for(int j=0;j<m2;j++)
mat2[i][j] = sc.nextInt();
System.out.println("Sum of mat1:");
for(int i=0;i<n1;i++){
int sum=0; for(int j=0;j<m1;j++) sum+=mat1[i][j];
System.out.println(sum);
}
System.out.println("Sum of mat2:");
for(int i=0;i<n2;i++){
int sum=0; for(int j=0;j<m2;j++) sum+=mat2[i][j];
System.out.println(sum);
}
}
public static void main(String[] args){
Solve1(sc);
// Solve2(sc); ...
// Solve18(sc);
}
}
# ================= USER CODE =================
def Solve1():
# 1. 3 số nguyên
a,b,c = map(int,input().split())
# Testcase Input: "1 2 3\n"
# Testcase Input Display On Screen:
# 1 2 3
# Testcase Expected: 3
# TODO: Logic xử lý ở đây và in ra kết quả
print(max(a,b,c))
def Solve2():
# 2. n số nguyên trong 1 dòng
n = int(input())
arr = list(map(int,input().split()))
# Testcase Input: "5\n1 3 5 2 4\n"
# Testcase Input Display On Screen:
# 5
# 1 3 5 2 4
# Testcase Expected: 5
# TODO: Logic xử lý ở đây và in ra kết quả
print(max(arr))
def Solve3():
# 3. ma trận n x m số nguyên
n,m = map(int,input().split())
mat = [list(map(int,input().split())) for _ in range(n)]
# Testcase Input: "2 2\n1 2\n3 4\n"
# Testcase Input Display On Screen:
# 2 2
# 1 2
# 3 4
# Testcase Expected: 4
# TODO: Logic xử lý ở đây và in ra kết quả
print(max(max(row) for row in mat))
def Solve4():
# 4. nhiều dòng input, mỗi dòng 1 số
n = int(input())
last = 0
for _ in range(n):
last = int(input())
print(last)
def Solve5():
s = input().strip()
print(s)
def Solve6():
line = input()
print(line)
def Solve7():
x,y = map(float,input().split())
print(max(x,y))
def Solve8():
c = input()[0]
print(c)
def Solve9():
flag = int(input())
print(flag)
def Solve10():
n = int(input())
words = input().split()
print(words[-1])
def Solve11():
n,m = map(int,input().split())
mat = [input().split() for _ in range(n)]
print(mat[-1][-1])
def Solve12():
T = int(input())
for _ in range(T):
a,b = map(int,input().split())
print(a+b)
def Solve13():
import sys
last = 0
for line in sys.stdin:
last = int(line)
print(last)
def Solve14():
import sys
a=[]
for line in sys.stdin:
if line.strip()=='': break
a.append(int(line))
print(a[-1])
def Solve15():
n=int(input())
vs=[input() for _ in range(n)]
print(vs[-1])
def Solve16():
n,m = map(int,input().split())
grid = [list(input().split()) for _ in range(n)]
print(grid[-1][-1])
def Solve17():
import sys
a=[]
for line in sys.stdin:
if line.strip()=='': break
a.append(int(line))
print(a[-1])
def Solve18():
n1,m1 = map(int,input().split())
mat1 = [list(map(int,input().split())) for _ in range(n1)]
n2,m2 = map(int,input().split())
mat2 = [list(map(int,input().split())) for _ in range(n2)]
print("Sum of mat1:")
for row in mat1:
print(sum(row))
print("Sum of mat2:")
for row in mat2:
print(sum(row))
# ================= MAIN =================
if __name__=="__main__":
Solve1()
# Solve2()
# ...
# Solve18()