Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string f1 = "a";
- string f2 = "b";
- string res = "";
- for(int i = 0;i<10;i++){
- res = f1+f2;
- f1 = f2;
- f2 = res;
- cout << res << endl;
- }
- return 0;
- }
- #include <stdio.h>
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- char f1[100];
- char f2[100];
- char res[100];
- char suma[100];
- strcpy(f1,"a");
- strcpy(f2,"b");
- strcpy(res,"");
- strcat(res,f2);
- cout << res;
- /*
- for(int i = 0;i<10;i++){
- res = f1+f2;
- f1 = f2;
- f2 = res;
- cout << res << endl;
- }
- */
- for(int i = 0;i<10;i++){
- strcpy
- }
- }
- /*
- int main ()
- {
- char str1[]="Sample string";
- char str2[40];
- char str3[40];
- strcpy (str2,str1);
- strcpy (str3,"copy successful");
- printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);
- return 0;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement