0 / 0 / 0
Регистрация: 16.03.2011
Сообщений: 44
|
|
1 | |
Считать текст из файла, и вывести только предложения, в которых нет запятой19.09.2011, 13:30. Показов 1910. Ответов 17
Метки нет (Все метки)
Написать програму которая считывает текст из файла и выводит на екран только предложения в которых нету запятой?
Это надо сделать через роботу с файлами.
0
|
19.09.2011, 13:30 | |
Ответы с готовыми решениями:
17
Считать текст из файла. Вывести на экран только восклицательные предложения Считать текст из файла и вывести на экран только восклицательные предложения Считать текст из файла и вывести на экран только предложения не содержащие запятых Считать текст из файла и вывести на экран монитора только определенные предложения |
0 / 0 / 0
Регистрация: 16.03.2011
Сообщений: 44
|
|
19.09.2011, 13:46 [ТС] | 3 |
нету вариантов потому и спрашиваю если можете помогите плз с заданием
0
|
19.09.2011, 13:58 | 4 |
pashokman, читаете строку до первой точки или до конца файла, далее проходите по символам. Если встретится запятая - выходите из цикла и читайте следующее предложение. Если дошли до нуль-терминатора, то это значит, что запятая не встретилась, и можно выводить предложение. Реализация - за вами.
0
|
0 / 0 / 0
Регистрация: 16.03.2011
Сообщений: 44
|
|
19.09.2011, 14:27 [ТС] | 5 |
вот с етим у меня и возникла проблема я словами могу описать решение а как кодом написать не знаю
0
|
программист С++
860 / 600 / 147
Регистрация: 19.12.2010
Сообщений: 2,014
|
||||||
19.09.2011, 15:12 | 7 | |||||
на вход:
There are times when a generic (in the sense of general as opposed.
to template-based programming) type is needed: variables that are truly variable, accommodating. values of many other more specific types rather than C++'s normal strict and static types. We can distinguish three basic kinds of generic type. Converting types that can hold one of a number of possible value types, e.
ответ:
Text:
There are times when a generic (in the sense of general as opposed. to template-based programming) type is needed: variables that are truly variable, accommodating. values of many other more specific types rather than C++'s normal strict and static types. We can distinguish three basic kinds of generic type. Converting types that can hold one of a number of possible value types, e. Parse: There are times when a generic (in the sense of general as opposed to template-based programming) type is needed: variables that are truly variable, accommodating values of many other more specific types rather than C++'s normal strict and static types We can distinguish three basic kinds of generic type Converting types that can hold one of a number of possible value types, e Answer: There are times when a generic (in the sense of general as opposed values of many other more specific types rather than C++'s normal strict and static types We can distinguish three basic kinds of generic type
1
|
0 / 0 / 0
Регистрация: 16.03.2011
Сообщений: 44
|
|
19.09.2011, 15:16 [ТС] | 8 |
sandye51 спасибо за ришение но не могли бы вы написать это на С а не на С++?
0
|
В астрале
8049 / 4806 / 655
Регистрация: 24.06.2010
Сообщений: 10,562
|
|
19.09.2011, 15:20 | 9 |
pashokman, Перепишите. В чем проблема-то?
0
|
Заблокирован
|
||||||
19.09.2011, 15:21 | 10 | |||||
Вот на Си
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]. Вывод консоли
Gravitational collapse is the inward fall of a body due to the influence of its own gravity. Gravitational collapse is at the heart of structure formation in the universe. The compression caused by the collapse raises the temperature until nuclear fue l reignites in the center of the star and the collapse comes to a halt. The thermal pressure gradient (leading to expansion) compensates the gravity (l eading to compression) and a star is in dynamical equilibrium between these two forces. In this sense a star is in a "temporary" equilibrium state between a gravitatio nal collapse at stellar birth and a further gravitational collapse at stellar de ath. The end states are called compact stars. No physical force can therefore prevent the star from collapsing to a singulari ty (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]. Enter any key
1
|
0 / 0 / 0
Регистрация: 16.03.2011
Сообщений: 44
|
|
19.09.2011, 15:24 [ТС] | 11 |
ВСЕМ БОЛЬШОЕ СПАСИБО!!!
0
|
19.09.2011, 15:29 | 12 | |||||
pashokman, так вы никогда не станете программистом.
опоздал
0
|
19.09.2011, 15:41 | 14 |
-=ЮрА=-, ладно. У меня это решается простым оператором &&.
Почему вы читаете текст в двоичном режиме? Что будет, если вам попадётся огромный файл, больше размера памяти, которую может выделить вам система? Да и вообще, ftell не учтёт файлы больше 2GB. Ну и так далее. Давайте и дальше искать недоработки в программах друг друга. Особенно в такой манере. Я смотрю, вам это нравится.
0
|
nxnx
|
19.09.2011, 15:42
#15
|
Не по теме: talis,
0
|
talis
|
19.09.2011, 15:46
#16
|
Не по теме: nxnx, да нет, вроде. По крайней мере я ;)
0
|
sandye51
|
19.09.2011, 15:50
#17
|
Не по теме: nxnx, просто -=ЮрА=-'e сделали пару замечаний в пред. темах, он их неадекватно воспринял, теперь будет пытаться докапаться в ответ :-)
2
|
Заблокирован
|
|
19.09.2011, 17:57 | 18 |
Не по теме
talis, - в своей жизни текстовик 2GB встречали???"rb" позволяет корректно разбирать "\r\n" в текстовом режиме иногда бывают грабли - это нравится не мне например есть люди , ну а у вас частенько поддакивание им происходит. Пиши те мирно как это я делаю (и не ищите красных карточек за офтоп как некоторые...) и вам слова никто не скажетЯ приветсвую критику там где она уместна + экономлю на хедерах и предпочитаю Си в форточках, кому ближе пингвин с плючам, ну пиши себе на здоровье других не трогай
0
|
19.09.2011, 17:57 | |
19.09.2011, 17:57 | |
Помогаю со студенческими работами здесь
18
Считать текст с файла, вывести только предложения, содержащие заданное слово Считать текст из файла и вывести на экран только предложения, не содержащие запятых Считать текст из файла и вывести на экран только предложения, начинающиеся с тире Считать текст из файла и вывести на экран только предложения, не содержащие запятых Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |