Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Pac update
/* **samuel ugochukwu nwutobo **Pac update */ #include <iostream> using namespace std; char pac[15][15]; void build(); void print(); void update(); int main() { build(); print(); cout<<"X X X X X X X X X X"; cout<<endl; update(); print(); } void build() { for(int x=0; x< 15; x++ ) { for(int y=0; y< 15; y++ ) { pac[x][y] = '0'; if(x==0&&y==0||x==1&&y==0||x==0&&y==1||x==1&&y==1) { pac[x][y] = '3';} if(x==3&&y==3||y==4&&x==3||y==3&&x==4||y==4&&x==4) { pac[x][y] = '4';} }} } void print() { for(int x=0; x<15; x++ ) { for(int y=0; y< 15; y++ ) { cout<<pac[y][x]; } cout<<endl; } cout<<sizeof(pac); cout<<endl; } void update() { for(int x=0; x<15; x++ ) { for(int y=0; y< 15; y++ ) { if(pac[x][y]=='3') pac[x][y] = '5';}}}
run
|
edit
|
history
|
help
0
return reference (gcc)
template
simple use of templete
ClassQuiz2
InviteList
Visakh
Clementina
stack::emplace for 30-second c++
C++
Geometric Series