c++86 [백준] 2440번 별 찍기 - 3(c++) https://www.acmicpc.net/problem/2440 2440번: 별 찍기 - 3 첫째 줄에는 별 N개, 둘째 줄에는 별 N-1개, ..., N번째 줄에는 별 1개를 찍는 문제 www.acmicpc.net 답 #include using namespace std; int main(void){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>>n; for(int i=n;i>0;i--){//1번 for(int j=i;j>0;j--){//2번 cout 2023. 12. 23. [백준] 2439번 별 찍기 - 2(c++) https://www.acmicpc.net/problem/2439 답 #include using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>>n; for(int i=n;i>0;i--){//1번 for(int k=i-1;k>0;k--){//2번 cout 2023. 12. 23. [백준] 2438번 별 찍기 - 1(c++) https://www.acmicpc.net/problem/2438 2438번: 별 찍기 - 1 첫째 줄에는 별 1개, 둘째 줄에는 별 2개, N번째 줄에는 별 N개를 찍는 문제 www.acmicpc.net 답 #include using namespace std; int main(){ ios_base::sync_with_stdio(0); int n; cin>>n; for(int i=0;i 2개 -> ... -> n개가 출력될 것이다. 또한 두번째 for문이 끝날때마다 줄바꿈을 해줘서 모양을 만들었다. 끝 2023. 12. 23. [백준] 9086번 문자열(c++) https://www.acmicpc.net/problem/9086 9086번: 문자열 입력의 첫 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 10)가 주어진다. 각 테스트 케이스는 한 줄에 하나의 문자열이 주어진다. 문자열은 알파벳 A~Z 대문자로 이루어지며 알파벳 사이에 공백은 없으 www.acmicpc.net 답 #include using namespace std; int main(){ ios_base::sync_with_stdio(0) int n; cin>>n; string a; for(int i=0;i>a; cout 2023. 12. 23. [백준] 1008번 A/B(c++) https://www.acmicpc.net/problem/1008 1008번: A/B 두 정수 A와 B를 입력받은 다음, A/B를 출력하는 프로그램을 작성하시오. www.acmicpc.net 답 #include using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); double a,b; cin>>a>>b; cout.precision(9); cout 2023. 12. 23. [백준] 1001번 A-B(c++) https://www.acmicpc.net/problem/1001 1001번: A-B 두 정수 A와 B를 입력받은 다음, A-B를 출력하는 프로그램을 작성하시오. www.acmicpc.net 답 #include using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int a,b; cin>>a>>b; cout 2023. 12. 23. 이전 1 ··· 11 12 13 14 15 다음