Перевести из pascal в с var a, b: longint; n, m: byte; begin readln(a); readln(n); b : = 0; while a > 0 do begin m : = a mod 10; if m < > n then b : = b * 10 + m; a : = a div 10; end; while b > 0 do begin a : = a * 10 + b mod 10; b : = b div 10; end; writeln(a); end.
int main(void) {
long int a, b=0;
int n, m;
scanf("%d",&a);
scanf("%d",&n);
while (a>0) {
m = a % 10;
if (m != n) b = b*10+m;
a = a / 10;
}
while (b != 0) {
a = a*10 + b%10;
b = b/10;
}
printf("a = %d",a);
return 0;
}
Пример:
125272
157