Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- aux = vetor[i+8];
- vetor[i+8] = vetor[i];
- vetor[i] = aux;
- #include <stdio.h>
- int main() {
- int arr[5] = {1,2,3,4,5};
- int num = sizeof(arr) / sizeof(int);
- int vetor[num];
- int i, count;
- count = 0;
- for (i = num-1; i >= 0; i--) {
- vetor[count] = arr[i];
- count ++;
- }
- for (i = 0; i < num; i++) {
- printf("%d n", vetor[i]);
- }
- return (0);
- }
- #include <vector>
- #include <algorithm>
- void main() {
- std::vector<int> vetor_xpto;
- //quando popular pode usar...
- std::reverse(vetor_xpto.begin(), vetor_xpto.end());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement