24 lines
440 B
C++
24 lines
440 B
C++
|
#include <bits/stdc++.h>
|
||
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
|
||
|
// 7.5, 7.6 feladatok megoldasai
|
||
|
|
||
|
long long factorial (long long n) {
|
||
|
if (n==0) return 1;
|
||
|
return n * factorial(n-1);
|
||
|
}
|
||
|
|
||
|
int stringToInt (string n) {
|
||
|
if (n == "") return 0;
|
||
|
return (stringToInt(n.substr(0, n.size() -1)) * 10) + n.back() - '0' ;
|
||
|
}
|
||
|
|
||
|
int maximum(vector<int> v) {
|
||
|
|
||
|
}
|
||
|
|
||
|
int main () {
|
||
|
cout<<factorial(13);
|
||
|
cout<<endl<<stringToInt("7839");
|
||
|
}
|