Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
ponyerb orange panther
Assignment 3
sphere
to upper case string
B_141202_funcionesString
Jai
a3
1
Print Micro Seconds
Programação em C, testes