Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<locale.h>
- using namespace std;
- int main(void){
- setlocale(LC_ALL,"Russian");
- char st[80], st1[80];
- char* pst=st;
- char* pst1=st1;
- cin.getline(st,80);
- cin.getline(st1,80);
- while((*pst!=0)||(*pst1!=0)){
- *pst++;
- *pst1++;
- if(*pst != *pst1){
- if(*pst>*pst1){
- cout<<"1";
- break;
- }
- if(*pst<*pst1){
- cout<<"-1";
- break;
- }
- }
- else if(*pst==0)
- cout<<"0";
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment