Python
# -*- coding:utf-8 -*-
import sys, os
class Solution:
def do(self, ):
return
if __name__ == '__main__':
# 读取输入的一个整数,浮点数,字符/字符串, int, float, str
v = int(sys.stdin.readline().strip()) # value
# 读取输入的一行的两个整数,浮点数,字符/字符串
n, m = list(map(str, sys.stdin.readline().strip().split(" "))) # int, float, str
# 读取输入的二维矩阵整数,浮点数,字符/字符串
matrix = []
for i in range(n):
values = list(map(int, sys.stdin.readline().strip().split(" "))) # int, float, str
matrix.append(values)
# 解决方案,自己添加需要传入的参数
S = Solution()
ret = S.do() # matrix
# 处理返回值
if ret:
print('true')
else:
print('false')
C++
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution1 {
public:
bool Find() {
return false;
}
};
int main()
{
int r, c; // 一行输入两个数
cin >> r >> c;
string str;
std::cin >> str; // 一行输入y一个字符串
// 输入r行,c列数据,存储到vector中
vector<vector<int>> grid;
int temp;
for (int i = 0; i < r; i++)
{
vector<int> nums;
for (int a = 0; a < c; a++)
{
cin >> temp;
nums.push_back(temp);
}
grid.push_back(nums);
}
// 输入r行,c列数据,存储到数组中
int **arr = new int*[r];
for (int i = 0; i<r; i++)
arr[i] = new int[c];
for (int i = 0; i<r; i++)
for (int j = 0; j<c; j++)
cin >> arr[i][j];
// while处理多个case
while (cin >> str)
std::cout << str << std::endl;
// 以逗号为分隔符拆分字符串
const char * split = ",";
char *char_str = (char *)str.c_str();
char *p = strtok(char_str, split);
int a;
vector<int> nums;
while (p != NULL)
{
sscanf(p, "%d", &a);
nums.push_back(a);
p = strtok(NULL, split);
}
// 向解决方案函数传参
Solution1 s = Solution1();
bool t = s.Find();
// 处理返回值
if (t == 1)
cout << "true";
else
cout << "false";
}