Ввод-Вывод файлов В С++

Автор работы: Пользователь скрыл имя, 10 Декабря 2011 в 01:48, лабораторная работа

Описание

Изучение реализации в языке С++ возможностей ввода-вывода файлов.

Работа состоит из  1 файл

kursovoy.doc

— 1.29 Мб (Скачать документ)

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14])

                                    p++;

                              k=0;

                              continue; 

                        case 15:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15])

                                    p++;

                              k=0;

                              continue; 

                        case 16:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16])

                                    p++;

                              k=0;

                              continue; 

                        case 17:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17])

                                    p++;

                              k=0;

                              continue; 

                        case 18:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18])

                                    p++;

                              k=0;

                              continue; 

                        case 19:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19])

                                    p++;

                              k=0;

                              continue; 

                        case 20:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&

               B[i-19]==B[i-20])

                                    p++;

                              k=0;

                              continue; 

                        case 21:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&

                                     B[i-19]==B[i-20]&&B[i-20]==B[i-21])

                                    p++;

                              k=0;

                              continue; 

                        case 22:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&

                                     B[i-19]==B[i-20]&&B[i-20]==B[i-21]&&B[i-21]==B[i-22])

                                    p++;

                              k=0;

                              continue; 

                        case 23:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&

                                     B[i-19]==B[i-20]&&B[i-20]==B[i-21]&&B[i-21]==B[i-22]&&

                                     B[i-22]==B[i-23])

                                    p++;

                              k=0;

                              continue; 

                        case 24:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&

                                     B[i-19]==B[i-20]&&B[i-20]==B[i-21]&&B[i-21]==B[i-22]&&

                                     B[i-22]==B[i-23]&&B[i-23]==B[i-24])

                                    p++;

                              k=0;

                              continue; 

                        case 25:

                              if(B[i-1]==B[i-2]&&B[i-2]==B[i-3]&&B[i-3]==B[i-4]&&

                                     B[i-4]==B[i-5]&&B[i-5]==B[i-6]&&B[i-6]==B[i-7]&&

                                 B[i-7]==B[i-8]&&B[i-8]==B[i-9]&&B[i-9]==B[i-10]&&

                                     B[i-10]==B[i-11]&&B[i-11]==B[i-12]&&B[i-12]==B[i-13]&&

                                 B[i-13]==B[i-14]&&B[i-14]==B[i-15]&&B[i-15]==B[i-16]&&

                                     B[i-16]==B[i-17]&&B[i-17]==B[i-18]&&B[i-18]==B[i-19]&&                          

                                     B[i-19]==B[i-20]&&B[i-20]==B[i-21]&&B[i-21]==B[i-22]&&

                                     B[i-22]==B[i-23]&&B[i-23]==B[i-24]&&B[i-24]==B[i-25])

                                    p++;

                              k=0;

                              continue; 

                  }

            }

            i++;

      }

      cout<<"Количество слов, состоящих из одной и той же буквы: "<<p;

      getch();

      return 0;

} 

     4.4 Реализация программы представлена на рисунке 1:

        
 
 
 

Информация о работе Ввод-Вывод файлов В С++