,   CyberForum.ru

Sentence. - C++

C++ http://www.cyberforum.ru/cpp-beginners/thread1232181.html
: : #include<iostream> using namespace std; int main() { int n; cin>>n; cout<<((n/1000==n%10)&&(n/100/10==n%100%10))?1:37<<endl;; return 0;
C++ push ( ) , . , push ( ). . . #include <conio.h> #include <iostream.h> struct Node { int left; Node *next; }; Node *beg = 0; http://www.cyberforum.ru/cpp-beginners/thread1232179.html
C++ ?
void Sort(char *text, int len, TCHAR* ptr, bool newFile) { char *info; int i=0,b=0; char loly; int lol; int j=0; char info1; info=(char*)malloc(len*sizeof(char)); strcpy(info,"");
C++
" ". , / , , . : " 484 112" / " 11 4" = " 44 28" " 484 112" * " 11 4" = " 5324 448"
C++ http://www.cyberforum.ru/cpp-beginners/thread1232100.html
. . , . .
C++ Microsoft Visual C++ 2010 Express - . " " . , Debug, : =================================================================================== Unable start program '(c:\users\... ). .

Neotwalker
21 / 1 / 0
: 22.12.2013
: 129
22.07.2014, 18:36     Sentence.
Once upon a time in a land far far away, inhabited only by math students, Iva and Vedran were discussing self-explanatory sentences. A part of these sentences is exactly one number and it is equal to the total number of letters in the sentence. Some examples are: This sentence has thirtyone letters., Blah blah seventeen.
Little Jurica overheard his friends' conversation and decided to impress them with the amount of self-explanatory sentences he knows by heart. He rushed back home and wrote a programme which will, given a sentence, tell him the minimum number he can put inside so that the sentence is valid. Unfortunately, his computer broke and now he needs your help. Write a programme to help Jurica! The form of the sentence is: word1 word2 word3  $ wordn−1 wordn. The character $ represents the place where the number should be put in.
For example, the form of the sentence this sentence has thirtyone letters would be this sentence has $ letters.
The rules that apply to writing numbers are the following:

numbers from 1 to 10 are written one, two, three, four, five, six, seven, eight, nine, ten, respectively
numbers from 11 to 19 are written eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen
the remaining double digit numbers are written in a way that we name the tens' digit and add to it the name of the one digit remaining when we remove the tens' digit. Specially, if by removing the tens' digit we remain with zero, we add nothing to it
the tens' digits (respectively from 2 to 9) are named the following: twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety
three digit numbers are written in a way that we name the hundreds' digit number and add to it the number of the double digit number remaining. Specially, if by removing the hundreds' digit we remain with zero, we add nothing to it
the hundreds' digits (respectively from 1 to 9) are named the following: onehundred, twohundred, threehundred, fourhundred, fivehundred, sixhundred, sevenhundred, eighthundred, ninehundred
the rules that apply for numbers with more than three digits are not relevant because the input data will always be such that the output is less than a thousand

Examples of naming some numbers:

68 = sixty + eight = sixtyeight
319 = threehundred + nineteen = threehundrednineteen
530 = fivehundred + thirty = fivehundredthirty
971 = ninehundred + seventy + one = ninehundredseventyone

The first line of input contains the integer N (`1 ≤ N ≤ 20), the number of words in the sentence. Each of the following N lines contains a word not longer than 50 lowercase letters of the English alphabet or the character $ (none of the words will be the name of a number).
The character $ will appear exactly once.
The first and only line of output must contain the required sentence.
The numbers are named as mentioned before, even if the sentence sounds gramatically incorrect.
The input data will be such that a solution will always exist and is less than 1000.
Sample Input #1

5
this
sentence
has
$
letters

Sample Output #1

this sentence has thirtyone letters.
--------------------------
, :
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
    int k;
    string bolchis[10] = { " ", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
    string malchis[20] = { " ", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" };
    string chis(int k);
    {
        string r = " ";
            if (k >= 100)
                r += malchis[k / 100] + "hundred";
            k %= 100;
        if (k < 20)
            r += malchis[k];
        else
            r += bolchis[k / 10] + malchis[k % 10];
        }
    return 0;
}
.
 
: 01:55. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
@Mail.ru