2019-12-04 00:47:19 +00:00
|
|
|
|
|
|
|
static void set_test_pass()
|
|
|
|
{
|
|
|
|
asm("li x27, 0x01");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void set_test_fail()
|
|
|
|
{
|
|
|
|
asm("li x27, 0x00");
|
|
|
|
}
|
|
|
|
|
2020-03-29 15:19:14 +00:00
|
|
|
|
|
|
|
int mul = 3;
|
|
|
|
int div = 3;
|
|
|
|
|
2019-12-04 00:47:19 +00:00
|
|
|
int main()
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int sum;
|
|
|
|
|
2020-03-29 15:19:14 +00:00
|
|
|
mul = 6;
|
|
|
|
//div = 3;
|
|
|
|
|
2019-12-04 00:47:19 +00:00
|
|
|
sum = 0;
|
|
|
|
|
2020-03-29 15:19:14 +00:00
|
|
|
// sum = 5050
|
2019-12-04 00:47:19 +00:00
|
|
|
for (i = 0; i <= 100; i++)
|
|
|
|
sum += i;
|
|
|
|
|
2020-03-29 15:19:14 +00:00
|
|
|
// sum = 3775
|
|
|
|
for (i = 0; i <= 50; i++)
|
|
|
|
sum -= i;
|
|
|
|
|
|
|
|
// sum = 22650
|
|
|
|
sum = sum * mul;
|
|
|
|
|
|
|
|
// sum = 7550
|
|
|
|
sum = sum / div;
|
|
|
|
|
|
|
|
if (sum == 7550)
|
2019-12-04 00:47:19 +00:00
|
|
|
set_test_pass();
|
|
|
|
else
|
|
|
|
set_test_fail();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|