Added GoodString Code

This commit is contained in:
Adhish Anand
2018-10-08 15:38:46 +05:30
parent 4da95e9a22
commit ab9cb406db
2 changed files with 41 additions and 0 deletions

31
code/GoodString.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <iostream>
#include <string>
#include<stdio.h>
#include<cstring>
using namespace std;
class GoodString
{
int t;
public:
GoodString(int x)
{
t=x;
}
void newstring(string str)
{
for(int i=0;i<t;i++)
cout<<str.at(i);
}
};
int main ()
{
int n;
cin>>n;
GoodString ob(n);
string str;
getchar();
getline(cin,str);
ob.newstring(str);
return 0;
}