Задача 1.
#include
using namespace std;
int euclid(int a, int b)
{
int t;
while (b != 0) {
t = b;
b = a%b;
a = t;
}
return a;
while (a != b)
if (a > b)
a -= b;
else
b -= a;
if (b = 0)
return a;
else
return euclid(b,a%b);
}
int main(){
int a, b;
cin >> a >> b;
cout << euclid(a, b) << endl;<br> return 0;
}
Задача 2.
#include
#include
using namespace std;
void main(){
const char separator[] = " !.,";
char s[256];
char *ptr = NULL;
int i;
cin.getline(s,256);
ptr = strtok(s, separator);
while (ptr) {
for (i = 0; i < strlen(ptr); ++i)
if (isdigit(ptr[i])!=0)
break;
if (i == strlen(ptr))
cout << ptr << "\n";<br> ptr = strtok(0, separator);
}
}