Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
#include
void funkcija(int n, int * niza) { int x = niza[0]; int nova_niza[n]; nova_niza[0] = x; int j = 1; for(int i = 1; i < n; i++) { if(x > niza[i]) { nova_niza[j] = niza[i]; j++; x = niza[i]; } else { if(niza[i] < 0) { } else { x--; nova_niza[j] = x; j++; } } } for(int i = 0; i < j; i++) { printf("%d ", nova_niza[i]); } } int main(int argc, const char * argv[]) { int n; scanf("%d", &n); int niza[n]; for(int i =0 ; i < n; i++) { scanf("%d", &niza[i]); } funkcija(n, niza); } /* 14 12 -6 20 15 -1 10 6 -7 -20 14, 12, -6, -7, -8, -9, -10, -20 */
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)