C/C++の宿題を片付けます 96代目
at TECH
394:デフォルトの名無しさん
07/09/27 00:07:06
>>391
#include<string.h>
#include<iostream>
using namespace std;
int main(){
char s[]="ABCDEFGHIJKLMN";
int size = strlen(s);
char*end = s + size;
int shift;
while(cout << "どれだけシフトしますか--> ",cin>>shift){
shift %= size;
if(shift < 0)shift += size;
rotate(s,end-shift,end);
cout << s << endl;
}
cout<<endl;
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5282日前に更新/230 KB
担当:undef