mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-12-22 05:12:40 +00:00
Added GoodString Code
This commit is contained in:
parent
4da95e9a22
commit
ab9cb406db
10
README.md
10
README.md
@ -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)
|
||||
[![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
|
||||
- Software Engineer in India
|
||||
- [![twitter-alt][twitter-img]](https://twitter.com/webmasteradi)
|
||||
|
31
code/GoodString.cpp
Normal file
31
code/GoodString.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user