powerunlimited

Untitled

Dec 26th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <string.h>
  4. using namespace std;
  5.  
  6. int main(){
  7.     char    Q1[100];
  8.     string  Q = "Must you be so linear, Jean-Luc 0 123";
  9.     cin.getline(Q1, 99);
  10.     if(strlen(Q1) > 1)  Q = Q1;
  11.       int i,j=0,k=1,b=0;
  12.       string a;
  13.  
  14.       for ( i = b;i<100;++i){
  15.           if ((Q[i]>='A'&&Q[i]<='Z')||(Q[i]>='a'&&Q[i]<='z')||(Q[i]='-'))
  16.              a=a+Q[i];
  17.           else
  18.              b=i+1;
  19.              cout<<k<<':'<<a<<endl;
  20.              ++k;
  21.              j=0;
  22.       }
  23.       system("PAUSE");
  24.       return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment