日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

1133:输出亲朋字符串

發(fā)布時(shí)間:2024/5/6 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 1133:输出亲朋字符串 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

時(shí)間限制: 1000 ms 內(nèi)存限制: 65536 KB
提交數(shù): 5873 通過數(shù): 4388

【題目描述】

編寫程序,求給定字符串s的親朋字符串s1。

親朋字符串s1定義如下:給定字符串s的第一個(gè)字符的ASCII值加第二個(gè)字符的ASCII值,得到第一個(gè)親朋字符; 給定字符串s的第二個(gè)字符的ASCII值加第三個(gè)字符的ASCII值,得到第二個(gè)親朋字符;依此類推,直到給定字符串s的倒數(shù)第二個(gè)字符。親朋字符串的最后一個(gè)字符由給定字符串s的最后一個(gè)字符ASCII值加s的第一個(gè)字符的ASCII值。

【輸入】

輸入一行,一個(gè)長度大于等于2,小于等于100的字符串。字符串中每個(gè)字符的ASCII值不大于63。

【輸出】

輸出一行,為變換后的親朋字符串。輸入保證變換后的字符串只有一行。

【輸入樣例】

1234

【輸出樣例】

cege

【來源】

No

code

/*^....0^ .1 ^1^.. 011.^ 1.0^ 1 ^ ^0.11 ^ ^..^0. ^ 0^.0 1 .^.1 ^0 .........001^.1 1. .111100....01^00 ^ 11^ ^1. .1^1.^ ^0 0^.^ ^0..1.1 1..^1 .0 ^ ^^ 00. ^^0.^1 ^ 0 ^^110.^0. 0 ^ ^^^10.01^^ 010^ 1 1 ^^^1110.10001 10 0 ^ 1.1 ^^^11111100^ 10 . 01 ^^ ^^ ^^^1111^1.^ ^^^10 10^ 0^ ^^111^^^0.1^ 1....^11 0 ^^11^^^ 0.. ....1^ ^ ^1. 0^ ^11^^^ ^ 1 111^ ^ 0.10 00 11 ^^^^^ 1 0 1.0^ ^0 ^0 ^^^^ 0 0.0^ 1.0 .^ ^^^^ 1 1 .0^.^ ^^ 0^ ^1 ^^^^ 0. ^.11 ^ 11 1. ^^^ ^ ^ ..^^..^ ^1 ^.^ ^^^ .0 ^.00..^ ^0 01 ^^^ .. 0..^1 .. .1 ^.^ ^^^ 1 ^ ^0001^ 1. 00 0. ^^^ ^.0 ^.1. 0^. ^.^ ^.^ ^^^ ..0.01 .^^. .^ 1001 ^^ ^^^ . 1^. ^ ^. 11 0. 1 ^ ^^ 0.0 ^. 0 ^0 1 ^^^ 0.0.^ 1. 0^ 0 .1 ^^^ ...1 1. 00 . .1 ^^^ ..1 1. ^. 0 .^ ^^ ..0. 1. .^ . 0 ..1 1. 01 . . ^ 0^.^ 00 ^0 1. ^ 1 1.0 00 . ^^^^^^ ..^ 00 01 ..1. 00 10 1 ^^.1 00 ^. ^^^ .1.. 00 .1 1..01 ..1.1 00 1. ..^ 10^ 1^ 00 ^.1 0 1 1.1 00 00 ^ 1 ^. 00 ^.^ 10^ ^^1.1 00 00 10^..^ 1. ^. 1.0 1 ^. 00 00 .^^ ^. ^ 1 00 ^0000^ ^ 011 0 ^. 00.0^ ^00000 1.00.1 11. 1 0 1^^0.01 ^^^ 01.^ ^ 1 1^^ ^.^1 1 0... 1 ^1 1^ ^ .01 ^ 1.. 1.1 ^0.0^ 0 1..01^^100000..0^1 1 ^ 1 ^^1111^ ^^0 ^ ^ 1 1000^.1 ^.^ . 00.. 1.1 0. 01. . 1. .^1. 1 1. ^0^ . ^.1 00 01^.0 001. .^*/ // An_all_in_one_book_on_Informatics —— 1133.cpp created by VB_KoKing on 2019,04,29,08. /* Procedural objectives:Variables required by the program:Procedural thinking:Functions required by the program:*/ /* My dear Max said: "I like you, So the first bunch of sunshine I saw in the morning is you, The first hurricane that passed through your ear is you, The first star you see is also you. The world I see is all your shadow."FIGHTING FOR OUR FUTURE!!! */ #include <iostream> #include <string> using namespace std; int main() {string str;cin>>str;for (int i = 0; i < str.length(); i++)cout<<char(str[i]+str[(i+1)%str.length()]);return 0; }

總結(jié)

以上是生活随笔為你收集整理的1133:输出亲朋字符串的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。