#C, 77 bytes
C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
t=1,100,10000,... is used for padding. As long as a or b is not zero keep multiplicating the last digit %10 with t and accumulate. Then erease the last digit of a and b (/=10) and shift t by 2 digits (*=100).
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
#C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
t=1,100,10000,... is used for padding. As long as a or b is not zero keep multiplicating the last digit %10 with t and accumulate. Then erease the last digit of a and b (/=10) and shift t by 2 digits (*=100).
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
t=1,100,10000,... is used for padding. As long as a or b is not zero keep multiplicating the last digit %10 with t and accumulate. Then erease the last digit of a and b (/=10) and shift t by 2 digits (*=100).
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
#C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
t=1,100,10000,... is used for padding. As long as a or b is not zero keep multiplicating the last digit %10 with t and accumulate. Then erease the last digit of a and b (/=10) and shift t by 2 digits (*=100).
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
#C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
#C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
t=1,100,10000,... is used for padding. As long as a or b is not zero keep multiplicating the last digit %10 with t and accumulate. Then erease the last digit of a and b (/=10) and shift t by 2 digits (*=100).
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}
#C, 77 bytes
-2 bytes for removing redundant braces (* is associative).
r,t;f(a,b){t=1;r=0;while(a|b)r+=t*(a%10)*(b%10),a/=10,b/=10,t*=100;return r;}
Ungolfed and usage:
r,t;
f(a,b){
t=1;
r=0;
while(a|b)
r+=t*(a%10)*(b%10),
a/=10,
b/=10,
t*=100;
return r;
}
main(){
printf("%d\n", f(1276,933024));
}