![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
|
Array rotate in wrong way
Hi! I make c++ programm for school and I have problem with array rotation for 90 degree. I make array rotation from one example, but there is an array rotation on wrong way, I need to make it to rotate to other way. So please help me. Here is code:
Code:
//array mas[100][100]
j=i; // this is cube array size like i=100;
for (n=0; n<=j/2; n++)
{
for (m=0; m<=j-1; m++)
{
x=n;
y=m;
tmp=mas[j-n+1][m];
mas[j-n+1][m]=mas[y][x];
tmp2=mas[j-m+1][j-n+1];
mas[j-m+1][j-n+1]=tmp;
tmp=mas[x][j-m+1];
mas[x][j-m+1]=tmp2;
mas[y][x]=tmp;
}
}
2 6 3 9 Here is output: 6 9 2 3 Needed output (I need this output): 3 2 9 6 |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|