728x90
반응형
from os import system
from time import sleep
# string = "HELLO"
# #string = ['H','E','L','L','O']
# length = len(string)
# while True:
# for i in range(length):
# print(string[i:])
# sleep(0.5)
# system("cls")
number = "123456789"
length = len(number)
while True:
for i in range(length):
#print(number.replace(number[i], "i"))
print(number.insert(i))
sleep(0.5)
system("cls")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <Windows.h>
#include <cstdlib>
using namespace std;
class Billboard
{
private:
char* name;
public:
Billboard()
{
name = NULL;
}
void SetInfo(char* name)
{
this->name = name;
}
~Billboard()
{
delete[]name;
}
};
int main(void)
{
Billboard bill;
char stn[100];
cout << "Input string : ";
cin >> stn;
int len = strlen(stn) + 1;
char* charstn = new char[len];
strcpy(charstn, stn);
bill.SetInfo(charstn);
int i;
char* temp;
while (true)
{
for (i = 0; i < len; i++)
{
temp = charstn[i];
cout << charstn + i << temp << endl;
Sleep(500);
system("cls");
}
}
return 0;
}
728x90
반응형
'Data Structure & Algorithm' 카테고리의 다른 글
Basic (0) | 2022.10.19 |
---|---|
sequential test (0) | 2022.10.19 |
[Python]Move to sidways Strings (0) | 2022.10.18 |
Linked List(+dummy) (0) | 2022.09.19 |
Simple Linked List(+dummy) (0) | 2022.09.19 |