Programming Language/C++ (8) 썸네일형 리스트형 C++ 뒤집은 소수 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 #include #include #include #include using namespace std; int prime[101]; int ints[101]; string s[101]; bool isPrime(int x){ int chk; if (x >= 2){ chk = 0; for (int i = 2; i > n; int temp; for (int i = 0; i > s[i]; temp = reverse(stoi.. C++ 가장 많이 사용된 자리의 수 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #include #include #include #include using namespace std; int main(){ int temp = 0, max_nums = 0, max_cnt = 0, i=0; string s; cin >> s; int s_length = s.size(); int *arr = new int[s_length]; for (char c : s){ arr[i] = (int)c-48; i++; } for (int i = 0; i max_cnt){ max_cnt = temp; max_nums = arr[i].. C++ Template Function 1234567891011121314151617 #include using namespace std; template void abc(T n1, T1 n2){ cout C++ 최소값(min), 최대값(max) 그리고 minmax() 123456789101112131415161718192021222324 #include #include using namespace std; int main(){ // min, max, minmax 는 #include 필요 그리고 자료형은 auto라는 점을 주의 // min, max의 경우 인자를 2개로 받음 auto result = min(1, 2); auto result2 = min(2, 3); cout C++ 문자열 정리 (String class) 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141#include #include #include using namespace std; int main(){ // [문자열] // 문자열 비교 stri.. C++ Template inline function 123456789101112131415#include using namespace std; template inline T SQUARE(T x){ return x*x;} int main(){ cout C++ 실수 mod 123456789101112 #include using namespace std; int main() { double a = 5.7; cout C++ 피보나치 수열 12345678910111213141516171819202122232425262728293031323334353637383940#include using namespace std; void fibo(int n){ if (n >= 1){ cout 이전 1 다음