Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int lenght(char str[])
- {
- int z=0;
- while (str[z] != '\0'){
- z++;
- }
- return z;
- }
- bool compear(char str1[], char str2[]){
- int l1 = lenght(str1);
- int l2 = lenght(str2);
- if (l1 != l2){
- return false;
- }
- int d = 0;
- while (d < l1){
- if ( str1[d] != str2[d]){
- return false;
- }
- d++;
- }
- return true;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- char str[200], str1[200];
- cin.getline(str,200);
- cin.getline(str1, 200);
- cout << compear(str, str1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement