Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string.h>
- using namespace std;
- int f(char a[51], int k)
- {
- int i;
- char rez[51];
- if(strlen(a)<k) cout<<"nu este posibil";
- else
- {
- for(i=0; i<k; i++)
- {
- cout<<a[i];
- }
- }
- }
- char s[51][51];
- int main ()
- {
- int n,i;
- cin>>n;
- for(i=1; i<=n; i++)
- {
- cin>>s[i];
- }
- for(i=1; i<=n; i++)
- {
- f(s[i],i);
- cout<<endl;
- }
- }
Add Comment
Please, Sign In to add comment