MIPI_AdvancedC_FRTK/Lect1/18_task_9_page_26.c

17 lines
266 B
C
Raw Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
#include <stdint.h>
int leftRotate(uint32_t n, uint32_t rotate)
{
return (n << rotate)|(n >> (32 - rotate));
}
int main ()
{
int32_t a, rotate, res;
scanf("%d %d",&a, &rotate);
res = leftRotate(a, rotate);
printf("%d", res);
return 0;
}