我当前的程序似乎有问题。
我要做的是创建一个程序,该程序输出在{
"Name": "Swap Role",
"Id": "",
"IsCustom": true,
"Description": "Lets developers perform slot swaps.",
"Actions": [
"microsoft.web/sites/diagnostics/siteswap/read",
"microsoft.web/sites/slots/diagnostics/siteswap/read",
"microsoft.web/sites/slots/slotsswap/action",
"microsoft.web/sites/slotsswap/action"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/subscriptions/{subscriptionId-1}/resourceGroups/Development",
"/subscriptions/{subscriptionId-2/resourceGroups/Development",
"/subscriptions/{subscriptionId}/resourceGroups/Test",
"/subscriptions/{subscriptionId-2/resourceGroups/Test",
"/subscriptions/{subscriptionId}/resourceGroups/Production",
"/subscriptions/{subscriptionId-2/resourceGroups/Production"
]
}
文件中找到的文本流的可能解密。
到目前为止,我已经创建了程序,但是遇到了问题。
.txt
基本上,在程序运行时,每个移位量旁边都会显示一次文本移位的每个ASCII值。
例如:
Run 0 Unjumbled: \ Run 1 Unjumbled: 2 Run 2 Unjumbled: x
如前所述,我正在尝试为程序中的每次运行创建不同的可能的消息输出。
答案 0 :(得分:0)
您可能需要在显示完整字符串之前先进行转换。然后进入文件的下一行。
在这里,我制作了一个示例,将文件中的一行转换为所有可能的值并显示它们,然后重复下一行直到文件结束。
#include <iostream>
#include <string>
#include <fstream>
int main()
{
std::ifstream inputFile;
std::string jumbled_message;
std::string unjumbled_message;
int line = 0;
inputFile.open("Jumbled Messages.txt");
if (!inputFile)
{
std::cerr << "Input File Cannot Be Found" << std::endl;
return 1;
}
while (inputFile)
{
getline(inputFile, jumbled_message);
unjumbled_message.resize(jumbled_message.size());
for (int shift = 0; shift < 255; shift++)
{
for(size_t i = 0; i < jumbled_message.size(); i++)
{
unjumbled_message[i] = jumbled_message[i] + shift;
}
std::cout<< "Line" << line << " - shift: " << shift
<< " - unjumbled: "<< unjumbled_message
<< std::endl;
}
unjumbled_message.clear();
line++;
}
return 0;
}