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
int vrati_dali_se_isti_dva_string(char *a, char *b) { int n = strlen(a); int m = strlen(b); if(n != m) { return -1; } for(int i = 0; i < n; i++) { if(a[i] != b[i]) { return -1; } } return 0; // 0 znaci deka se isti } int main() { FILE *f = fopen("in.txt", "r"); // treba da zememe podatoci od eden file int poceten_broj; fscanf(f, "%d", &poceten_broj); char niza[10]; int tip; float koeficient; float najgolem_koeficient = -99999.0; // mnogu mal broj int najgolem_tip = 99999.0; char najgolem_klub[10]; float proizvod_na_koeficienti = 1.0; while(1) { // dodeka raboti programata fscanf(f, "%s", niza); if(strcmp(niza, "#") == 0) {// ako nizata e ednakva na #, zavrsi go while loopot break; } fscanf(f, "%d", &tip); fscanf(f, "%f", &koeficient); if(koeficient > najgolem_koeficient) { najgolem_koeficient = koeficient; najgolem_tip = tip; strcpy(najgolem_klub, niza); } proizvod_na_koeficienti *= koeficient; } printf("%s %d %.2f\n", najgolem_klub, najgolem_tip, najgolem_koeficient); printf("%.2f\n", proizvod_na_koeficienti * poceten_broj); return 0; }
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)