Форум программистов, компьютерный форум, киберфорум
С++ для начинающих
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
Другие темы раздела
C++ Разбить ip адрес на составляющие. Задача такова получаем на входе строку типа string в которой содержится адрес вида "172.16.11.163" нужно получить четыре масива char по 3 элемента содержащие в себе числа адреса. например: string addr="172.16.11.163"; - на входе // что-то делаем char addrn - на выходе *addrn=172 *addrn=016 *addrn=011 *addrn=163 https://www.cyberforum.ru/ cpp-beginners/ thread353600.html Заполнение двумерного массива из файла. C++
Всем привет! Застопорился на следующем. Есть некий файл следующего содержания аа аb fg df df rt ty
C++ Задача на цикл, ошибка кода Помогите найти ошибку в коде, программа не компилируется... вот задание: Дано натуральное число n. Выяснить, можно ли представить n! в виде произведения трех последовательных целых чисел. #include <iosteam.h> int fact(int N) //Расчет факториала N { int result=1; for (int i=2; i<=N; i++) https://www.cyberforum.ru/ cpp-beginners/ thread353584.html C++ Ветвление в С++ Доброго времени суток. НЕзнаю как можно реализовать две задачи на ветвление. Может кто нибудь помочь. кодом? Буду оччень признателен. 1. На плоскости XOY задана своими координатами точка А. Указать, где она расположена: на какой оси или в каком координатном угле. 2. Даны три числа а, b, с. Определить, какое из них равно d. Если ни одно не равно d, то найти max(d — а, d— b, d— с). https://www.cyberforum.ru/ cpp-beginners/ thread353548.html
C++ Перебрать файлы в каталогах и переименовать их, нужна помощь
Добрый день. Есть следующая задача. В одном каталоге находятся картинки, все файлы без расширения. 1-Как перебрать все файлы формата "main_menu" в каталоге 2-Изменить наименование файла до формата "main_menu.png" Во втором каталоге находятся файлы .html и другие каталоги 1-Просканировать файлы .html 2-В тексте файла, в ссылке на картинку с "main_menu" дописать расширение...
C++ В матрице найти число с наибольшей дробной частью в каждой строке. https://www.cyberforum.ru/ cpp-beginners/ thread353537.html
Доброго утра! Всем! Вообщем требуется подсказка. Есть такая задача: В матрице найти число с наибольшей дробной частью в каждой строке. Вообщем задаем матрицу: 2.1 2.3 2.9 3.5 1.2 2.1 1.4 1.6
C++ как написать ln ln|(y-sqrt|x||)(x-y/z+pow(x,2.0) как написать на с++??? https://www.cyberforum.ru/ cpp-beginners/ thread353528.html C++ переход с делфи на цпп
здравствуйте ув. товарищи хотелось что бы вы подсказали какие нибудь ссылки с базовыми примерами для цпп т.к. я даже не знаю как присваивать по мойму было "==" вот так)) так же сышал том что в цпп уже нету понятия процедур всё только построено на функциях в общем хотелось бы какуе нибудь статью о базавых знаниях)) типы данных и т.д. надеюсь вы меня поняли))
C++ Проблема с класами https://www.cyberforum.ru/ cpp-beginners/ thread353511.html
Вот пытаюсь описать клас(умова задачи в коментариях)но когда запускаю выбивает какуюту ошыбку типа необратимое исключения типов и тд почему так? вот код // Individ 4 Class.cpp: определяет точку входа для консольного приложения. // /*Розробити клас Pupil з полями Прізвище, Номер школи, Клас, Успішність(1..12). Реалізувати різні види конструкторів, методи вводу і виводу, методи get і set...
C++ Заполнение класса в цикле цикл: int _tmain(int argc, _TCHAR* argv) { int d,m,y; ZapBook* z=new ZapBook; int length=0; char flag='y'; while(flag=='y') { cout<<"Vedite Familiyu"<<"\n"; https://www.cyberforum.ru/ cpp-beginners/ thread353508.html
using namespace std; C++
Здравствуйте. Я заметил, что многие программисты стараются избегать этой строчки в своих программах. С чем это связанно? И еще вопрос: почему ввод/вывод в функциях - это плохо?
C++ Циклы https://www.cyberforum.ru/ cpp-beginners/ thread353493.html
Помоему так A<C<B C<A<B B<C<A C<B<A A<B<C B<A<C Найти max и min значения а,b,c
Заблокирован
Автор FAQ
19.09.2011, 14:46 0

Вывести из файла все слова, которые начинаются на гласную букву - C++ - Ответ 1996481

19.09.2011, 14:46. Показов 1451. Ответов 5
Метки (Все метки)

Ответ

Цитата Сообщение от Shab13 Посмотреть сообщение
Вивести из файла все слова котрые начинаются на гласную букву. Слова записаны на английском.
ООООЧень нужна помощь!
Вот на Си
C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdlib.h> //malloc
#include <string.h> //strlen strtok
#include <stdio.h>  //i/o
 
int main()
{
    long sLen;
    char * str, *buf;
    char glasn[] = "aeyuoiAEYUOI";
    char delim[] = " ,.!?\n";
    FILE * f = fopen("text.txt","rb+");
    if(!f)
        printf("Error open text.txt\r\n");
    else
    {
        fseek(f,0,SEEK_END);
        sLen = ftell(f);
        fseek(f,0,SEEK_SET);
        if(!(str = (char *)malloc(sLen + 1)))
            printf("allocation memory error\r\n");
        else
        {
            fread(str,sLen,1,f);
            str[sLen] = '\0';
        }
        fclose(f);
        if(str)
        {
            buf = strtok(str,delim);
            while(buf)
            {
                if(strchr(glasn,buf[0]))
                    printf("%s ",buf);
                buf = strtok(NULL,delim);
            }
        }
    }
    printf("\r\nEnter any key\r\n");
    char ch;scanf("%c",&ch);
    return 0;
}
text.txt
Gravitational collapse is the inward fall of a body due to the influence of its own gravity. In any stable body, this gravitational force is counterbalanced by the internal pressure of the body, in the opposite direction to the force of gravity (gravity being generally orientated to the center of mass). If the inwards pointing gravitational force, however, is stronger than the total combination of the outward pointing forces, the equilibrium becomes unbalanced and a collapse occurs until the internal pressure increases above that of the gravitational force and a equilibrium is once again attained (the exception being black holes).
Because gravity is comparatively weak compared to other fundamental forces, gravitational collapse is usually associated with very massive bodies or collections of bodies, such as stars (including collapsed stars such as supernovae, neutron stars and black holes) and massive collections of stars such as globular clusters and galaxies.
Gravitational collapse is at the heart of structure formation in the universe. An initial smooth distribution of matter will eventually collapse and cause a hierarchy of structures, such as clusters of galaxies, stellar groups, stars and planets. For example, a star is born through the gradual gravitational collapse of a cloud of interstellar matter. The compression caused by the collapse raises the temperature until nuclear fuel reignites in the center of the star and the collapse comes to a halt. The thermal pressure gradient (leading to expansion) compensates the gravity (leading to compression) and a star is in dynamical equilibrium between these two forces.
Gravitational collapse of a star occurs at the end of its lifetime, also called the death of the star. When all stellar energy sources are exhausted, the star will undergo a gravitational collapse. In this sense a star is in a "temporary" equilibrium state between a gravitational collapse at stellar birth and a further gravitational collapse at stellar death. The end states are called compact stars.
The types of compact stars are:
White dwarfs, in which gravity is opposed by electron degeneracy pressure;
Neutron stars, in which gravity is opposed by neutron degeneracy pressure and short-range repulsive neutron-neutron interactions mediated by the strong force;
Black holes, in which the physics at the center is unknown.
The collapse to a white dwarf takes place over tens of thousands of years, while the star blows off its outer envelope to form a planetary nebula. If it has a companion star, a white dwarf-sized object can accrete matter from a companion star until it reaches the Chandrasekhar limit, at which point gravitational collapse takes over again. While it might seem that the white dwarf might collapse to the next stage (neutron star), they instead undergo runaway carbon fusion, blowing completely apart in a Type Ia supernova. Neutron stars are formed by gravitational collapse of larger stars, the remnant of other types of supernova.
Even more massive stars, above the Tolman-Oppenheimer-Volkoff limit cannot find a new dynamical equilibrium with any known force opposing gravity. Hence, the collapse continues with nothing to stop it. Once it collapses to within its Schwarzschild radius, not even light can escape from the star, and hence it becomes a black hole. According to theories, at some point later the collapsing object will reach the maximum possible energy density for a certain volume of space or the Planck density (as there is nothing that can stop it), where the known laws of gravity cease to be valid.[1] There are competing theories as to what occurs at this point, but it can no longer really be considered gravitational collapse at that stage.
It might be thought that a sufficiently large neutron star could exist inside its Schwarzschild radius and appear like a black hole without having all the mass compressed to a singularity at the center; however, this is a misconception. Within the event horizon, matter would have to move outwards faster than the speed of light in order to remain stable and avoid collapsing to the center. No physical force can therefore prevent the star from collapsing to a singularity (at least within the currently understood framework of general relativity). A model for nonspherical collapse in general relativity with emission of matter and gravitational waves was presented in [2].


Вывод консоли
is inward of a influence of its own In any is internal of in opposite of orienta
ted of If inwards is of outward equilibrium unbalanced and a occurs until intern
al increases above of and a equilibrium is once again attained exception is othe
r is usually associated or of as as and and of as and is at of in universe An in
itial of eventually and a of as of and example a is of a of interstellar until i
n of and a expansion) and a is in equilibrium of a occurs at end of its also of
all energy are exhausted undergo a In a is in a equilibrium a at and a at end ar
in is opposed electron in is opposed and interactions in at is unknown a over o
f of years off its outer envelope a If it a a object accrete a until it at over
again it instead undergo apart in a Ia are of of other of Even above a equilibri
um any opposing it Once it its even escape and it a According at object energy a
of or is it) of are as occurs at it at It a exist inside its and appear a all a
at is a event outwards of in order and avoid a understood of A in emission of a
nd in
Enter any key


Вернуться к обсуждению:
Вывести из файла все слова, которые начинаются на гласную букву C++
1
Заказать работу у эксперта
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
19.09.2011, 14:46
Готовые ответы и решения:

Вывести из файла все слова, которые начинаются на заданную букву
Написать программу которая читает англ. текст с файла и выводит на экран все слова что начинаются...

Вывести все слова, которые начинаются и заканчиваются на одну букву
Задан текст заканчивающийся точкой. Вывести все слова, которые начинаются и заканчиваются на одну...

Вывести только те слова, которые начинаются на гласную букву
Помогите написать программу, в которой есть два текстовых поля (richTextBox). В 1 текстовое поле...

Вывести на экран все слова из файла, которые начинаются на заданную букву
Создать текстовый файл, состоящий из слов (например в редакторе «Блокнот»). Необходимо: ...

5
19.09.2011, 14:46
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
19.09.2011, 14:46
Помогаю со студенческими работами здесь

Вывести на экран из файла все слова, которые начинаются на букву, введенную с клавиатуры пользователем
создать типизированный файл,элементами которого являются 60 слов случайной длины.Вывести на экран...

Вывести на экран из файла все слова, которые начинаются на ту же букву, что и последнее слово
Создать файл, состоящий из слов. Вывести на экран все слова, которые начинаются на ту же букву, что...

Удалить из строки русские слова, которые начинаются на гласную букву
Дана строка, в которой содержится осмысленное текстовое сообщение. Слова сообщения разделяются...

Удалите из сообщения только те русские слова, которые начинаются на гласную букву
Здравствуйте, помогите пожалуйста написать программу в С#, а то я в этом вообще ноль (( Задание:...

Удалить из сообщения только те русские слова, которые начинаются на гласную букву
Используя регулярное выражение, удалите из сообщения только те русские слова, которые начинаются на...

Считать из файла количество строк, которые начинаются на гласную букву
Молодежь, кто может написать программу, которая считывает из файла количество строк которые...

0
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru