![]() |
#2
yangfrancis2018-01-09 11:37
|

#include<iostream>
using namespace std;
/*int check(char one);
int check(char one, char two);
int numberDecode(string code)
{
if (code[0]=='0'||code.size() == 0) return 0;
if (code.size() == 1) return check(code[0]);
int fn = 0, fn_1 = 0, fn_2 = 1;
fn_1 = check(code[0])*check(code[1]) + check(code[0], code[1]);
for (int i=2; i < code.size(); i++)
{
if (check(code[i])) fn += fn_1;
if (check(code[i - 1], code[i])) fn += fn_2;
if (fn == 0) return 0;
fn_2 = fn_1;
fn_1 = fn;
}
return fn_1;
}
int check(char one)//check the rage from 1 to 9
{
return (one != '0') ? 1 : 0;
}
int check(char one, char two)//check the rage from 1 to 26
{
return (one == '1' || (one == '2'&&two <= '6')) ? 1 : 0;
}
int main()
{
string s = "24";
cout << numberDecode(s) << endl;
return 0;
}*/
int main()
{
cout << "hello world" << endl;
return 0;
}
using namespace std;
/*int check(char one);
int check(char one, char two);
int numberDecode(string code)
{
if (code[0]=='0'||code.size() == 0) return 0;
if (code.size() == 1) return check(code[0]);
int fn = 0, fn_1 = 0, fn_2 = 1;
fn_1 = check(code[0])*check(code[1]) + check(code[0], code[1]);
for (int i=2; i < code.size(); i++)
{
if (check(code[i])) fn += fn_1;
if (check(code[i - 1], code[i])) fn += fn_2;
if (fn == 0) return 0;
fn_2 = fn_1;
fn_1 = fn;
}
return fn_1;
}
int check(char one)//check the rage from 1 to 9
{
return (one != '0') ? 1 : 0;
}
int check(char one, char two)//check the rage from 1 to 26
{
return (one == '1' || (one == '2'&&two <= '6')) ? 1 : 0;
}
int main()
{
string s = "24";
cout << numberDecode(s) << endl;
return 0;
}*/
int main()
{
cout << "hello world" << endl;
return 0;
}
错误:
1>------ 已启动生成: 项目: NumberDecode, 配置: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(355,5): error MSB6006: “CL.exe”已退出,代码为 -1073741515。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
是少了什么东西吗。。代码没问题vc6上可以运行出结果的。。。