codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> using namespace std; int Array[] = {1,2,3,4,5,6,7,8,9}; int Array2[] = {11,12,13,14,15,16,17,18,19}; int najmniejszy_dzielnik(int m){ cout<<"Array["<<m<<"] = "<<Array[m]<<endl; return Array[m]; } int* czynniki_pierwsze(int m){ int temp,i, helper; for(temp=m, i=1; i < temp; i++){ helper=najmniejszy_dzielnik(temp); cout<<"test1, array[5] = "<<Array[5]<<endl; Array2[i]=helper; //------------------------------problem here cout<<"test2, array[5] = "<<Array[5]<<endl; temp/=helper; cout<<"test3, array[5] = "<<Array[5]<<endl; } Array2[0]=i; return Array2; } int main () { czynniki_pierwsze(8); return 0; }
Private
[
?
]
Run code
Submit