c++ dynamic array function
JuliusCaesarusedhiswaytoencrypttext.Eachletterisreplacedbythefollowinginalphabeticalo...
Julius Caesar used his way to encrypt text. Each letter is replaced by the following in alphabetical order by K positions in the circle.
You are given a cypher. Your task is to write a program that outputs plain text.
Note:
cypher - encrypted message.
plain text - decrypted message.
Input
Input contains two rows.
First row is a cypher, consisting of uppercase Latin characters.
Second row contains number K.
Output
Output must contain the result of the decryption, that is, plain text.
Sample test(s)
№ Input (cypher) Output (plain text)
1 XPSE
1 WORD
2 ZABC
3 WXYZ 展开
You are given a cypher. Your task is to write a program that outputs plain text.
Note:
cypher - encrypted message.
plain text - decrypted message.
Input
Input contains two rows.
First row is a cypher, consisting of uppercase Latin characters.
Second row contains number K.
Output
Output must contain the result of the decryption, that is, plain text.
Sample test(s)
№ Input (cypher) Output (plain text)
1 XPSE
1 WORD
2 ZABC
3 WXYZ 展开
1个回答
展开全部
#include <iostream>
using namespace std;
void swap2(unsigned int *a, unsigned int *b)
{
unsigned int c;
c = *a;
*a = *b;
*b = c;
}
int main()
{
unsigned int a, b;
cin >> a >> b;
swap2(&a, &b);
cout << a << " " << b << endl;
return 0;
}
using namespace std;
void swap2(unsigned int *a, unsigned int *b)
{
unsigned int c;
c = *a;
*a = *b;
*b = c;
}
int main()
{
unsigned int a, b;
cin >> a >> b;
swap2(&a, &b);
cout << a << " " << b << endl;
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询