Fmod
#include <stdio.h>#include<math.h>int main(int argc, char *argv[]){ float a,b,c; while (scanf("%f %f",&a,&b)) { c=fmod(a,b); printf("%f\n",c); } return 0;}
View code
# Include <stdio. h>
# Include <math. h>
Int main (INT argc, char * argv [])
{
Float a, B, c;
While (scanf ("% F", & A, & B ))
{
C = fmod (A, B );
Printf ("% F \ n", C );
}
Return 0;
}
Floor rounded down
#include <stdio.h>#include<math.h>int main(int argc, char *argv[]){ float a,b,c; while (scanf("%f",&a)) { c=floor(a); printf("%f\n",c); } return 0;}
View code
# Include <stdio. h>
# Include <math. h>
Int main (INT argc, char * argv [])
{
Float a, B, c;
While (scanf ("% F", & ))
{
C = floor ();
Printf ("% F \ n", C );
}
Return 0;
}
Ceil rounded up
#include <stdio.h>#include<math.h>int main(int argc, char *argv[]){ float a,b,c; while (scanf("%f",&a)) { c=ceil(a); printf("%f\n",c); } return 0;}
View code
# Include <stdio. h>
# Include <math. h>
Int main (INT argc, char * argv [])
{
Float a, B, c;
While (scanf ("% F", & ))
{
C = Ceil ();
Printf ("% F \ n", C );
}
Return 0;
}
Sin sine function
#include <stdio.h>#include<math.h>#define PI 3.1415926int main(int argc, char *argv[]){ float a,c; while (scanf("%f",&a)) { c=sin(a/180*PI); printf("%f\n",c); } return 0;}
View code
# Include <stdio. h>
# Include <math. h>
# Define PI 3.1415926
Int main (INT argc, char * argv [])
{
Float a, c;
While (scanf ("% F", & ))
{
C = sin (A/180 * PI );
Printf ("% F \ n", C );
}
Return 0;
}
Rounding
#include <stdio.h>#include<math.h>int main(int argc, char *argv[]){ float a,b,c; while (scanf("%f",&a)) { c=floor(a+0.5); printf("%f\n",c); } return 0;}
View code
# Include <stdio. h>
# Include <math. h>
Int main (INT argc, char * argv [])
{
Float a, B, c;
While (scanf ("% F", & ))
{
C = floor (a + 0.5 );
Printf ("% F \ n", C );
}
Return 0;
}