.


:




:

































 

 

 

 


: .

 

 

7

 

:

 

:

15

 

: 10702214

 

: .. .

 

2014

 


7. .

: .

1

, , .

:

#include <iostream>

 

using namespace std;

 

int main()

{

setlocale(LC_ALL, "RUS");

char s[10] = "";

bool b = 0;

scanf("%s", s);

for (int i = 0; i <= sizeof(s) - 1; i++)

if (s[i] > 55 || s[i] < 48 && s[i]!= 0)

b = 1;

if (!b)

cout << "" << endl;

else

cout << " " << endl;

system("pause");

}

:

2

:

#include <iostream>

 

using namespace std;

 

char c[] = "Create hyperlinks by dragging and dropping. Add graphics and multimedia elements in seconds. Make screenshots of your application with the integrated screenshot tool and enhance them quickly with the screenshot editing program. Compile your project to any supported output format with a couple of clicks. Work in collaboration with a team of authors all editing the same project at the same time. Produce help and documentation faster and more efficiently and have fun in the process!";

void fun1();

void fun2();

void fun3();

 

int main()

{

setlocale(LC_ALL, "RUS");

fun1();

fun2();

fun3();

for (int i = 0; i <= sizeof(c) - 1; i++)

cout << c[i];

system("pause");

}

 

void fun1()

{

int n = 0;

for (int i = 0; i <= sizeof(c) - 1; i++)

if (c[i] >= 97 && c[i] <= 122)

n++;

cout << " : " << n << endl;

}

 

void fun2()

{

int n = 1;

int a;

cout << ", 'v': ";

for (int i = 0; i <= sizeof(c) - 1; i++)

{

if (c[i] == 32)

{

a = i+1;

n++;

}

if (c[i] == 118)

{

do

{

cout << c[a];

a++;

}

while (c[a] >= 97 && c[a] <= 122);

break;

}

}

cout << endl << " : " << n << endl;

}

 

void fun3()

{

int a = 0;

int b;

for (int i = 0; i <= sizeof(c) - 1; i++)

{

if ((c[i] == 32 && c[i + 1] == 115) || c[i] == 83)

{

a = i;

do

{

a++;

} while (c[a] >= 97 && c[a] <= 122 || c[a] == 32 && c[a + 1] == 115 || c[a] == 83);

b = i;

for (b; b <= sizeof(c) - 1; b++)

c[b] = c[a++];

 

}

}

}

:

3

, ,

:

 

#include <iostream>

#include <cstdio>

 

using namespace std;

 

void zap(int);

 

FILE *in;

FILE *out;

char ch;

int n = 1, str = 0;

bool b = 0;

 

int main()

{

setlocale(LC_ALL, "RUS");

if ((in = fopen("File.txt", "r"))!= NULL)

{

if ((out = fopen("File2.txt", "w"))!= NULL)

{

ch = getc(in);

while (ch!= EOF)

{

if (ch == '0' || ch == '1')

b = 1;

if (ch == '\n' && b)

{

zap(n - str);

str = n + 1;

b = 0;

}

else

if (ch == '\n')

str = n + 1;

n++;

ch = getc(in);

}

}

}

fclose(in);

fclose(out);

system("pause");

}

 

void zap(int kol)

{

char mm;

fseek(in, -kol - 2, 1);

for (int i = 1; i <= kol + 1; i++)

{

mm = getc(in);

putc(mm, out);

}

}

 

:

 

: .

 



<== | ==>
- . | : for, while, do while.
:


: 2017-02-24; !; : 407 |


:

:

, - , ; , - .
==> ...

1636 - | 1639 -


© 2015-2024 lektsii.org - -

: 0.013 .