Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string>
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     freopen("input.txt", "r", stdin);
  11.     const int maxSize = 100; //максимальный размер строки (измени если надо)
  12.     char in[maxSize]; //создаем массив
  13.     for(int i=0; i<maxSize; i++) in[i]=' '; //заполняем массив пробелами
  14.     gets(in);
  15.     for(int i=0; i<maxSize-2; i++) { //цикл по всему массивы
  16.         if(in[i]=='n' && in[i+1]=='=') { //если итый элемент равен 'n' и и+1й элемент равен '=' (ищем n=)
  17.             int pos = 2;
  18.             while(in[i+pos] != ' ' && i<maxSize) {
  19.                 cout<<in[i+pos];
  20.                 pos++;
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement