[Logo] Форум DL
  [DL]  На главную страницу 
Индекс форума ->Учебный процесс ГГУ/СШ 27 ->Проектирование цифровых систем 1, 2
Автор Сообщение
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[256];

unsigned __out __bits(8) res;

void main()
{
int k = 0;
for(int i = 0; in_str[i] != '#'; i++) {
if (in_str[i] >= '0' && in_str[i] <= '9') {
k++;
}
}
res = k;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[256];

unsigned __out __bits(8) res;

void main()
{
int k = 1;
for(int i = 0; in_str[i] != '#'; i++) {
if (in_str[i] >= '0' && in_str[i] <= '9') {
k++;
}
}
res = k;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
string in_str;
int out res;

void main()
{
int i;
string ch;

res = 0;

for (i = 0; i < len(in_str); i = i + 1)
{
ch = mid(in_str, i, 1);

if (ch == "*")
{
break;
}

if ((ch >= "0") && (ch <= "9"))
{
res = res + 1;
}
}
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
string in_str(db);
int out res(db);

void main()
{
int i;
string ch;

res = 0;

for (i = 0; i < len(in_str); i = i + 1)
{
ch = mid(in_str, i, 1);

if (ch == "*")
{
break;
}

if ((ch >= "0") && (ch <= "9"))
{
res = res + 1;
}
}
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];
unsigned __out __bits(8) res = 0;

void main()
{
int __bits(16) cnt = 0;

for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] >= '0' && in_str[i] <= '9')
{
cnt++;
}
}

res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128] = "q1w2*231";
unsigned __out __bits(16) res = 0;

void main()
{
int __bits(16) cnt = 0;

for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] >= '0' && in_str[i] <= '9')
{
cnt++;
}
}

res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];
unsigned __out __bits(1) res;

void main()
{
int __bits(16) cnt = 0;

for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] >= '0' && in_str[i] <= '9')
{
cnt++;
}
}

res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];
unsigned __out __bits(1) res;

void main()
{
int __bits(16) cnt = 0;

for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] >= '0' && in_str[i] <= '9')
{
cnt++;
}
}

res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(1) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] >= '0' && in_str[i] <= '9')
{
cnt++;
}
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];
unsigned __out __bits(16) res;
void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++)
{
if (in_str[i] == '1' || in_str[i] == '2' || in_str[i] == '3' ||
in_str[i] == '4' || in_str[i] == '5' || in_str[i] == '6' ||
in_str[i] == '7' || in_str[i] == '8' || in_str[i] == '9' ||
in_str[i] == '0') cnt++;
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(1) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++)
{
if (0 <= in_str[i] <= 9)
{
cnt++;
}
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(16) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++)
{
if (0 <= in_str[i] <= 9)
{
cnt++;
}
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(16) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++) {
if (in_str[i] == '1' ||
in_str[i] == '2' ||
in_str[i] == '3' ||
in_str[i] == '4' ||
in_str[i] == '5' ||
in_str[i] == '6' ||
in_str[i] == '7' ||
in_str[i] == '8' ||
in_str[i] == '9' ||
in_str[i] == '0' ) cnt++;
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(16) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++) {
if (in_str[i] == '1' ||
in_str[i] == '2' ||
in_str[i] == '3' ||
in_str[i] == '4' ||
in_str[i] == '5' ||
in_str[i] == '6' ||
in_str[i] == '7' ||
in_str[i] == '8' ||
in_str[i] == '9' ||
in_str[i] == '0' ) cnt++;
}
res = cnt;
}
Михаил Долинский

Темы: 2184
Сообщений: 52607

Мой профиль
char in_str[128];

unsigned __out __bits(16) res;

void main()
{
int __bits(16) cnt = 0;
for (int i = 0; in_str[i] != '*'; i++) {
if (in_str[i] == '1' ||
in_str[i] == '2' ||
in_str[i] == '3' ||
in_str[i] == '4' ||
in_str[i] == '5' ||
in_str[i] == '6' ||
in_str[i] == '7' ||
in_str[i] == '8' ||
in_str[i] == '9' ||
in_str[i] == '0' ||) cnt++;
}
res = cnt;
}
 
Индекс форума ->Учебный процесс ГГУ/СШ 27 ->Проектирование цифровых систем 1, 2
Time:0,013