mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-11-16 01:07:26 +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)
|
- [![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
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