Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
swap_talent.c
#include <stdio.h> int main( ) { int s,t=0,a[10],b[10],n; scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&a[i]); for(int i;i<n-1;i++) { if(a[i]>a[i+1]) t++; } if (t==0) printf("0"); else if(t==1||t==2) printf("1"); else printf("-1"); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
EUCLIDES BIEN
PRACTICA LISTA
DDD
printing float pointers
Area and Volume coding
Command Expressions in Gnu C: What's the value of a loop? void!
dynamic memory allocation.c
Cuenta codigos
scanf and integer manipulation
Spring 2017 Lab 4 v1
stackse - search stackoverflow differently
Please log in to post a comment.