SHARE
TWEET

Untitled

a guest Dec 10th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4. #include <cstring>
  5. #include "funzioni.h"
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10.      
  11.      fstream file;
  12.      file.open("INPUT.txt");
  13.      int n=0;
  14.      file>>n;
  15.      
  16.      char** r=new char*[n];
  17.      for(int i=0;i<n;i++){
  18.          r[i]=new char[M];
  19.      }
  20.      
  21.      file.getline(new char[2],2);
  22.      for(int i=0;i<n;i++){
  23.        
  24.         file.getline(r[i],M);
  25.         cout<<i+1<<")"<<r[i];
  26.         cout<<"\t"<<setw(15);
  27.         if(isPalindroma(r[i])){
  28.             cout<<"PALINDROMA"<<endl;
  29.         }else{
  30.             cout<<"NON PALINDROMA"<<endl;
  31.         }
  32.     }
  33.     cout<<endl;
  34.     cout<<"La stringa piu' lunga e' la n."<<indexLenMax(r,n)+1<<" con "<<strlen(r[indexLenMax(r,n)])<<" caratteri."<<endl;
  35.     cout<<endl;
  36.     cout<<"La stringa con piu' vocali e' la n."<<indexVocMax(r,n)+1<<" con "<<numeroVoc(r[indexVocMax(r,n)])<<" vocali."<<endl;
  37.     cout<<endl;
  38.     cout<<"La prima stringa ad avere il carattere @ รจ la n."<<firstindexAt(r,n)+1<<".";
  39.    
  40.    
  41.    
  42.     return 0;
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top