Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. const std = @import("std");
  2. const warn = std.debug.warn;
  3.  
  4. const parse = @import("byeparse\\atoi");
  5.  
  6. fn solve() usize {
  7.     //const f = "hello, this  is a    string with    some spaces   in it.";
  8.     const f = @embedFile("Input.txt");
  9.  
  10.     var spaces: usize = 0;
  11.     inline for(f) |idx, c| {
  12.         if (c == ' ') {
  13.             spaces += 1;
  14.         }
  15.     }
  16.  
  17.     return spaces;
  18. }
  19.  
  20. pub fn main() void {
  21.     const ns = comptime brk: {
  22.         @setEvalBranchQuota(3500);
  23.         break :brk solve();
  24.     };
  25.     warn("{}\n", ns);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement