코딩도장

코딩도장

변경이력

돌아가기
6 68개 문자 추가 123개 문자 삭제

2015年05月15日 17:50

erkgojnheorighoei

``1 //newint`{.cpp} 2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 31 #include <iostream> 42 #include <cstring> 53 using namespace std; 6475 int main() 86 { 97 int *a; 10 8 a = new int; 11 9 cout << "메모리양을 정하시오. : "; 120 cin >> *a; 131 cout << endl << endl; 142 153 int *num; 164 num = new int(*a); 175 cout << "입력받을 정수의 개수를 정하시오: "; 186 cin >> *num; 197 2018 int *count; 219 count = new int(*a); 220 231 int *total; 242 total = new int(*a); 253 264 for (int i=0;i<*num;i++){ 275 cout << i+1 << " 번째 숫자 입력 : "; 286 cin >> *count; 297 *total += *count; 3028 } 3129 cout << "입력된 정수의 합은 : " << *total - *a << endl; 320 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 331 342 delete a; 353 delete num; 364 delete count; 375 delete total; 386 } ```
``1 //newint`{.cpp} 2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 31 #include <iostream> 42 #include <cstring> 53 using namespace std; 6475 int main() 86 { 97 int *a; 10 8 a = new int; 11 9 cout << "메모리양을 정하시오. : "; 120 cin >> *a; 131 cout << endl << endl; 142 153 int *num; 164 num = new int(*a); 175 cout << "입력받을 정수의 개수를 정하시오: "; 186 cin >> *num; 197 2018 int *count; 219 count = new int(*a); 220 231 int *total; 242 total = new int(*a); 253 264 for (int i=0;i<*num;i++){ 275 cout << i+1 << " 번째 숫자 입력 : "; 286 cin >> *count; 297 *total += *count; 3028 } 3129 cout << "입력된 정수의 합은 : " << *total - *a << endl; 320 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 331 342 delete a; 353 delete num; 364 delete count; 375 delete total; 386 } ```
``1 //newint`{.cpp} 2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 31 #include <iostream> 42 #include <cstring> 53 using namespace std; 6475 int main() 86 { 97 int *a; 10 8 a = new int; 11 9 cout << "메모리양을 정하시오. : "; 120 cin >> *a; 131 cout << endl << endl; 142 153 int *num; 164 num = new int(*a); 175 cout << "입력받을 정수의 개수를 정하시오: "; 186 cin >> *num; 197 2018 int *count; 219 count = new int(*a); 220 231 int *total; 242 total = new int(*a); 253 264 for (int i=0;i<*num;i++){ 275 cout << i+1 << " 번째 숫자 입력 : "; 286 cin >> *count; 297 *total += *count; 3028 } 3129 cout << "입력된 정수의 합은 : " << *total - *a << endl; 320 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 331 342 delete a; 353 delete num; 364 delete count; 375 delete total; 386 } ```
5 82개 문자 추가 4개 문자 삭제

2015年05月15日 17:49

erkgojnheorighoei

```{1 //newint.cpp}2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 3 #include <iostream> 4 #include <cstring> 5 using namespace std; 6 7 int main() 8 { 9 int *a; 10 a = new int; 11 cout << "메모리양을 정하시오. : "; 12 cin >> *a; 13 cout << endl << endl; 14 15 int *num; 16 num = new int(*a); 17 cout << "입력받을 정수의 개수를 정하시오: "; 18 cin >> *num; 19 20 int *count; 21 count = new int(*a); 22 23 int *total; 24 total = new int(*a); 25 26 for (int i=0;i<*num;i++){ 27 cout << i+1 << " 번째 숫자 입력 : "; 28 cin >> *count; 29 *total += *count; 30 } 31 cout << "입력된 정수의 합은 : " << *total - *a << endl; 32 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33 34 delete a; 35 delete num; 36 delete count; 37 delete total; 38 } ```
```{1 //newint.cpp}2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 3 #include <iostream> 4 #include <cstring> 5 using namespace std; 6 7 int main() 8 { 9 int *a; 10 a = new int; 11 cout << "메모리양을 정하시오. : "; 12 cin >> *a; 13 cout << endl << endl; 14 15 int *num; 16 num = new int(*a); 17 cout << "입력받을 정수의 개수를 정하시오: "; 18 cin >> *num; 19 20 int *count; 21 count = new int(*a); 22 23 int *total; 24 total = new int(*a); 25 26 for (int i=0;i<*num;i++){ 27 cout << i+1 << " 번째 숫자 입력 : "; 28 cin >> *count; 29 *total += *count; 30 } 31 cout << "입력된 정수의 합은 : " << *total - *a << endl; 32 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33 34 delete a; 35 delete num; 36 delete count; 37 delete total; 38 } ```
```{1 //newint.cpp}2 //31번째 줄에서 그냥 *total 만 쓰면 *a 와 더해져서 값이 나오는거 같아서 *total에 *a를 뺏습니다. 3 #include <iostream> 4 #include <cstring> 5 using namespace std; 6 7 int main() 8 { 9 int *a; 10 a = new int; 11 cout << "메모리양을 정하시오. : "; 12 cin >> *a; 13 cout << endl << endl; 14 15 int *num; 16 num = new int(*a); 17 cout << "입력받을 정수의 개수를 정하시오: "; 18 cin >> *num; 19 20 int *count; 21 count = new int(*a); 22 23 int *total; 24 total = new int(*a); 25 26 for (int i=0;i<*num;i++){ 27 cout << i+1 << " 번째 숫자 입력 : "; 28 cin >> *count; 29 *total += *count; 30 } 31 cout << "입력된 정수의 합은 : " << *total - *a << endl; 32 cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33 34 delete a; 35 delete num; 36 delete count; 37 delete total; 38 } ```
4 14개 문자 추가 1043개 문자 삭제

2015年05月15日 17:46

erkgojnheorighoei

```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.4 #include <cstring> 3.5 using namespace std; 4.65.7 int main() 6.8 { 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.4 #include <cstring> 3.5 using namespace std; 4.65.7 int main() 6.8 { 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.4 #include <cstring> 3.5 using namespace std; 4.65.7 int main() 6.8 { 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
3 956개 문자 추가

2015年05月15日 17:45

erkgojnheorighoei

```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
```{.cpp} {.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ``````{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.}
2 3개 문자 추가 7개 문자 삭제

2015年05月15日 17:44

erkgojnheorighoei

```{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ```
```{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ```
```{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ```
1 Original

2015年05月15日 17:43

erkgojnheorighoei

{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ```
{.cpp} 31번째 줄에서 그냥*total만 썻을떄 값이 *a 값하고 더한거 처럼 나와서 뺏습니다. 1.#include <iostream> 2.#include <cstring> 3.using namespace std; 4. 5.int main() 6.{ 9. int *a; 10. a = new int; 11. cout << "메모리양을 정하시오. : "; 12. cin >> *a; 13. cout << endl << endl; 14. 15. int *num; 16. num = new int(*a); 17. cout << "입력받을 정수의 개수를 정하시오: "; 18. cin >> *num; 19. 20. int *count; 21. count = new int(*a); 22. 23. int *total; 24. total = new int(*a); 25. 26. for (int i=0;i<*num;i++){ 27. cout << i+1 << " 번째 숫자 입력 : "; 28. cin >> *count; 29. *total += *count; 30. } 31. cout << "입력된 정수의 합은 : " << *total - *a << endl; 32. cout << "입력된 정수의 평균은 : " << double(*total - *a) / double(*num) << endl; 33. 34. delete a; 35. delete num; 36. delete count; 37. delete total; 38.} ```
코딩도장

코딩도장은 프로그래밍 문제풀이를 통해서 코딩 실력을 수련(Practice)하는 곳입니다.

코딩도장 © 2014 · 문의 [email protected]
피드백 · 개인정보취급방침 · RSS

AltStyle によって変換されたページ (->オリジナル) /