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

View File

@ -68,6 +68,16 @@ Please note that this project is released with a [Code of Conduct](CODE_OF_CONDU
- [![twitter-alt][twitter-img]](https://twitter.com/adeonir) - [![twitter-alt][twitter-img]](https://twitter.com/adeonir)
[![github-alt][github-img]](https://github.com/adeonir) [![github-alt][github-img]](https://github.com/adeonir)
### Adhish Anand
- Student, Chitkara University
- Self-taught Developer, Aspiring Entreprenuer
- I am currently work on:
- Android Development
- Python
- Machine Learning
- [![github-alt][github-img]](https://github.com/adhishanand9)
### Aditya Choudhary ### Aditya Choudhary
- Software Engineer in India - Software Engineer in India
- [![twitter-alt][twitter-img]](https://twitter.com/webmasteradi) - [![twitter-alt][twitter-img]](https://twitter.com/webmasteradi)

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;
}