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(char * tekst, char * zbor) { int brojac = 0; for(int i = 0; i < strlen(tekst); i++) { if(tekst[i] == zbor[0]) { int ok = 1; for(int j = 0; j < strlen(zbor); j++) { if(tekst[i + j] != zbor[j]) { ok = -1; break; } } if(ok == 1) { brojac++; } } } printf("%d\n", brojac); } 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]); } int h; scanf("%d", &h); if(h > n) { printf("Ne validno h\n"); return 0; } for(int i = 0; i < n; i++) { if(i + h < n) { int ok = -1; for(int j = i; j < i + h; j++) { if(niza[j] == h) { ok = 1; break; } } if(ok == 1) { for(int j = i; j < i + h; j++) { printf("%d ", niza[j]); } printf("\n"); } } } } /* 11 4 15 1 42 52 5 39 2 18 87 91 5 */
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)