- A+B 输入输出练习I
SQL语句批量生产
- 2024-4-30 16:56:59 @
#include<iostream>
#include<string>
#include<vector>
using namespace std;
vector<string>result;
// 字段内容,操作,表明,巴拉
string solu(string s,string str1,string str2,string str3){
string str;
char a = '\'';
char b = ',';
str.push_back(a);
for(int i = 0;i<s.size();i++){
if(s[i] == ' '){
str.push_back(a);
str.push_back(b);
str.push_back(a);
}else{
str.push_back(s[i]);
}
}
str.push_back(a);
string ans;
ans = str1 + str2+str3+"("+str+");";
result.push_back(ans);
return ans;
}
int main(){
string str;
while(1){
getline(cin,str);
if(str == "quit"){
break;}
solu(str,"INSERT ","msq_sc ","VALUES");
// cout << solu(str,"INSERT ","msq ","VALUES")<<endl;
}
for(auto i:result){
cout << i<<endl;
}
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 1
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 907
- 已通过
- 152
- 上传者