From 72af0dedf9e18911da65b9a5c4906689e868d9fc Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Mon, 8 Jun 2026 17:10:31 +0800 Subject: [legacy] Add functional and performance test suites --- rcc-legacy/tests/functional/78_decbinoct.sy | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 rcc-legacy/tests/functional/78_decbinoct.sy (limited to 'rcc-legacy/tests/functional/78_decbinoct.sy') diff --git a/rcc-legacy/tests/functional/78_decbinoct.sy b/rcc-legacy/tests/functional/78_decbinoct.sy new file mode 100644 index 0000000..8cc78ba --- /dev/null +++ b/rcc-legacy/tests/functional/78_decbinoct.sy @@ -0,0 +1,31 @@ +int dec2bin(int a) +{ + int res; + int k; + int i; + int temp; + res=0; + k=1; + temp=a; + while(temp!=0) + { + i=temp%2; + res=k*i+res; + k=k*10; + temp=temp/2; + } + return res; + +} + +int main() +{ + int a; + a=400; + int res; + res=dec2bin(a); + putint(res); + res = 10; + putch(res); + return 0; +} -- cgit v1.2.3