#include <stdio.h> #include <string.h> #include <math.h> #include<algorithm> #include<string> #include<stdlib.h> #include<iostream> using namespace std; int main() { int n; while (scanf("%d", &n) != EOF) { if (n == 0) { printf("1\n"); } else { int x = n-1; int a=n%10; while (x--) { a = (n * a) % 10; } printf("%d\n", a); } } return 0; } /* Main.c:4:9: fatal error: algorithm: No such file or directory #include<algorithm> ^~~~~~~~~~~ compilation terminated. */ |
Double click to view unformatted code.