Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by code ( 13 years ago )
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <cmath>
#include <string>

using namespace std;

int main(){
 
 ios_base::sync_with_stdio(0);
 cout<<"************OUT PUT BY FILE************<<endl;
 ifstream cin("input.txt");
 
 string s,ans;
 int n;
 
 cin>>n>>s;
 ans = s;
 int len = ans.size();
 for(int i=1;i<n;i++){
  cin>>s;
  int j=0;
  while(j<len){
   if(ans[j] != s[j])
    break;
   j++;
  }
  len = j;
 }
 
 cout<<len;
 
 return 0;
}

 

Revise this Paste

Children: 68767
Your Name: Code Language: