#include #include #include //fukn c int main() { char zombiestring[40000] = {"10062\n15651\n1271\n14355\n7220\n\n4878\n1754\n8466\n4741\n2582\n3003\n5327\n3172\n1327\n6310\n\n22413\n4145\n22294\n\n23108\n30453\n\n2084\n3496\n4800\n1388\n8728\n6380\n6397\n2558\n2120\n6159\n\n25265\n20200\n2083\n\n7424\n5830\n2575\n2825\n2234\n6106\n5505\n2847\n2059\n7145\n7223\n\n58621\n\n2926\n9188\n7432\n1639\n7420\n1161\n5517\n2703\n5446\n\n2457\n5814\n1294\n3280\n8531\n8214\n4736\n1964\n1155\n2380\n\n2812\n1827\n5533\n1756\n1491\n4127\n6452\n5935\n1415\n6221\n3489\n2681\n4849\n5250\n\n2922\n10365\n5819\n10227\n2962\n2702\n\n2982\n9254\n14137\n5026\n9374\n\n5933\n2888\n2250\n4514\n1825\n5616\n3497\n2988\n1181\n3836\n1032\n5847\n5383\n\n5044\n5922\n3155\n1610\n5510\n5016\n6666\n7024\n4649\n2764\n6444\n\n12932\n\n4764\n4285\n1278\n5020\n5917\n1888\n4757\n6323\n5067\n1314\n1530\n5748\n5573\n5848\n\n6078\n6687\n5510\n7642\n6719\n4376\n7733\n1356\n4064\n4159\n\n7426\n1147\n4176\n2797\n9484\n7907\n10806\n\n24981\n21675\n9324\n\n5537\n5730\n1280\n2090\n2963\n5992\n6043\n5141\n3039\n2120\n3664\n3816\n3859\n5406\n\n1315\n8662\n2280\n11800\n10201\n3886\n\n3048\n4147\n3299\n3912\n1571\n4582\n1621\n2201\n4543\n5377\n3016\n5297\n5213\n1338\n3929\n\n5456\n4051\n1621\n5228\n2672\n3277\n4006\n4954\n1487\n5361\n3298\n4335\n3015\n1139\n\n2875\n6387\n2926\n5439\n3494\n5287\n3793\n3714\n4944\n1094\n6728\n3302\n6345\n\n9641\n5967\n10265\n1129\n3759\n5632\n4913\n6151\n\n5890\n4285\n3601\n3344\n7294\n6321\n2730\n6352\n2350\n7214\n4034\n1032\n\n4266\n2086\n12754\n8475\n5044\n9616\n\n27815\n19415\n\n7914\n11106\n6938\n10695\n6902\n2983\n3710\n\n7659\n3565\n1310\n11842\n\n8750\n17624\n9697\n16020\n\n4606\n6296\n2321\n1272\n3504\n7121\n2313\n8016\n7910\n4786\n\n11012\n12831\n3980\n12204\n\n7996\n7933\n1500\n1810\n4030\n8645\n1710\n7506\n8096\n8661\n\n5694\n4145\n3095\n3963\n2396\n5197\n6086\n6793\n5924\n5043\n1241\n5011\n\n2410\n7373\n6724\n2641\n1827\n8344\n6833\n8336\n6517\n1376\n\n6084\n9909\n1760\n10864\n4904\n6734\n9492\n\n8002\n4098\n\n17545\n1504\n17040\n14118\n\n1103\n5378\n6135\n6207\n3143\n5550\n5723\n5494\n2841\n1461\n2413\n2252\n1904\n3474\n\n1788\n5889\n7810\n8520\n5415\n4633\n1422\n9526\n6762\n\n1187\n2137\n6551\n8399\n1510\n7099\n3465\n5179\n\n7056\n3142\n3237\n4910\n6656\n3680\n2619\n5549\n5737\n4493\n5359\n1336\n\n4690\n6692\n4638\n5490\n6449\n1518\n5872\n7935\n7742\n1895\n4528\n\n4929\n5947\n5044\n1627\n5037\n6646\n5949\n2142\n2362\n3050\n6390\n5467\n5496\n\n11896\n13381\n1055\n3993\n4275\n12480\n\n1903\n1527\n3280\n3748\n3315\n1058\n2541\n4245\n4386\n4792\n4937\n2345\n2551\n1901\n\n2674\n9184\n3423\n1954\n2788\n5954\n7827\n4466\n4901\n\n4653\n12104\n14737\n8740\n4164\n\n5317\n5734\n4580\n3244\n5509\n4009\n2576\n4137\n1282\n5506\n3530\n3057\n5408\n5952\n1849\n\n9691\n16403\n16828\n\n3653\n6762\n2042\n4618\n4212\n6293\n4782\n2071\n6303\n1662\n6814\n\n3720\n6801\n2350\n4456\n4623\n3242\n2471\n4104\n4096\n3641\n4022\n3702\n3169\n\n7146\n5318\n1820\n3845\n4955\n4134\n8848\n6614\n5497\n\n11545\n4050\n20095\n\n8230\n11577\n6426\n4671\n11838\n\n1726\n7355\n8115\n2780\n\n1795\n4697\n10410\n8064\n2370\n9497\n1221\n\n2909\n6719\n2733\n4335\n1327\n1672\n1297\n6705\n5209\n6690\n5855\n5432\n3804\n\n7874\n7949\n6658\n1621\n8850\n3235\n9142\n2856\n\n6968\n7042\n\n7463\n8035\n4908\n5032\n4791\n2030\n1768\n8611\n2114\n8748\n\n11054\n16021\n9826\n11604\n4819\n\n11214\n4850\n11665\n1891\n1347\n4053\n4570\n\n66862\n\n1597\n6127\n6229\n11518\n9308\n9661\n11410\n\n13224\n1160\n1978\n13018\n14604\n\n2773\n3885\n2383\n2850\n1758\n5724\n4418\n4637\n1510\n3870\n3793\n4116\n6281\n2026\n\n3714\n2840\n2116\n3505\n3941\n6676\n5696\n3216\n6406\n4660\n4974\n2005\n5293\n\n2580\n1645\n5677\n5376\n6527\n4410\n6837\n3069\n2399\n3727\n5658\n4817\n5911\n\n2126\n2851\n2766\n8660\n8181\n3449\n2765\n1299\n\n18470\n9129\n17956\n14494\n\n1033\n4468\n5938\n2874\n2406\n1175\n5997\n\n1256\n7932\n1544\n2772\n5709\n1348\n2919\n\n4399\n1449\n8295\n7470\n2088\n1958\n2857\n1722\n5204\n\n8161\n6865\n6428\n4807\n2173\n8614\n5109\n1769\n2125\n\n1112\n7417\n1328\n6385\n4670\n2840\n3293\n6438\n6639\n6129\n4144\n\n5554\n15529\n1499\n\n9459\n3175\n7412\n10610\n10283\n6807\n10056\n8657\n\n5195\n1397\n5365\n3713\n4376\n4034\n2480\n2665\n2566\n4664\n5262\n5913\n2455\n6048\n4488\n\n10875\n\n5322\n8688\n2636\n14243\n\n11403\n7465\n10079\n2270\n15254\n\n11758\n7630\n5137\n6345\n7119\n10008\n6125\n\n5184\n\n4306\n1159\n6483\n5131\n5009\n4585\n2996\n3514\n4009\n4788\n6841\n2189\n3030\n\n3132\n6730\n5733\n2747\n6464\n5221\n4567\n3528\n4264\n6006\n3295\n\n4829\n23038\n16150\n\n1519\n10692\n11102\n6321\n2948\n11851\n6301\n\n5787\n2664\n6046\n4527\n1955\n5270\n1557\n4567\n5631\n2150\n4612\n3044\n2568\n3589\n5334\n\n2303\n10849\n3983\n10010\n4854\n2111\n\n4576\n1236\n3111\n4898\n5930\n5241\n2783\n5451\n6549\n5623\n7257\n2589\n\n6031\n4307\n6669\n7866\n4333\n2069\n2778\n5463\n7149\n3091\n1001\n\n8737\n1843\n4676\n4381\n6164\n2616\n2453\n1739\n4845\n2909\n\n1396\n2963\n10672\n11217\n9975\n6511\n8694\n\n5262\n3743\n1895\n3811\n6089\n4659\n4195\n4633\n1928\n3865\n2166\n4947\n5040\n4052\n5291\n\n16754\n8916\n17259\n17813\n\n9683\n13286\n13577\n9343\n1792\n3335\n\n25505\n12891\n20104\n\n8618\n6560\n4584\n1118\n3931\n1229\n6759\n8275\n\n18418\n14090\n3552\n3156\n\n4681\n2564\n4557\n4838\n2048\n3097\n4513\n5181\n3803\n1857\n3836\n3089\n4322\n4049\n\n3768\n12991\n1680\n2378\n\n2609\n5115\n2179\n6126\n1423\n1300\n6113\n3720\n1279\n4681\n1147\n1728\n2087\n4708\n\n11919\n12306\n11697\n9806\n11749\n3995\n\n5298\n1877\n2065\n10499\n3493\n2892\n\n4172\n2913\n2288\n7358\n1065\n3030\n5316\n5023\n1876\n2610\n5309\n5175\n\n6904\n9471\n1232\n1741\n2239\n8554\n6327\n6507\n7603\n\n23962\n3536\n\n3214\n1102\n3823\n1876\n3929\n4890\n5526\n3009\n2619\n1565\n3364\n1392\n2407\n3129\n3586\n\n8438\n2649\n4887\n4306\n1675\n2870\n2014\n1160\n6542\n8475\n\n10172\n1686\n5999\n9145\n10361\n7814\n\n3049\n5192\n2091\n4788\n3460\n2701\n2441\n2485\n2440\n2256\n5054\n4631\n5652\n3636\n3827\n\n5944\n7870\n2055\n9296\n7574\n8691\n8852\n\n2178\n1658\n6451\n6725\n1093\n6265\n7412\n5641\n2348\n5377\n2680\n\n6607\n13797\n10728\n6412\n\n10824\n25891\n24424\n\n2278\n3407\n1688\n6069\n2324\n1868\n6037\n2496\n3324\n5346\n4118\n3881\n5260\n2094\n2334\n\n3330\n2884\n6186\n5513\n3483\n6790\n4571\n4173\n4569\n1909\n5574\n\n2073\n2159\n1468\n6189\n2770\n5299\n2039\n4247\n6289\n5453\n3797\n1432\n5501\n2600\n\n7484\n8409\n8216\n1966\n2720\n5125\n5532\n10092\n\n3704\n4032\n13787\n14642\n6007\n\n2893\n3724\n6947\n5569\n6284\n5015\n6589\n4359\n3846\n5402\n5771\n2995\n\n3027\n2193\n4194\n6211\n4912\n4523\n3402\n4199\n4777\n5955\n3217\n6162\n1556\n5269\n\n6162\n7433\n2853\n4649\n4505\n7220\n5276\n1873\n6655\n5549\n2992\n\n3304\n3655\n2028\n4079\n5182\n6830\n3885\n2274\n2769\n2514\n2146\n\n2616\n5717\n1758\n2847\n4579\n1853\n1556\n2043\n1293\n1566\n2327\n6678\n5738\n\n17934\n19341\n\n6652\n3289\n6927\n2152\n2094\n2458\n5635\n6927\n4626\n6846\n5324\n6085\n2571\n\n4344\n6656\n3831\n4768\n12536\n13166\n\n2696\n5427\n9429\n1393\n5758\n9578\n4958\n\n6889\n3107\n1112\n3035\n4159\n3697\n4832\n2604\n6318\n2804\n4325\n5497\n4214\n\n3588\n5313\n1330\n8568\n9017\n1794\n9578\n8426\n4836\n\n31988\n\n5561\n3355\n5593\n3448\n2235\n3836\n2375\n2690\n1704\n3729\n2626\n6329\n3297\n5067\n\n4244\n1729\n1598\n1025\n5921\n3214\n2230\n4120\n1274\n1136\n5798\n4259\n2821\n1968\n\n5291\n7790\n8452\n1235\n10438\n2069\n1365\n9288\n\n5533\n4261\n6170\n1884\n5315\n2901\n3588\n2903\n2441\n2264\n3162\n4188\n3993\n1592\n\n15202\n9385\n17135\n10731\n\n4591\n2068\n1136\n4292\n4351\n2100\n6075\n4463\n5887\n4507\n1273\n3815\n3595\n4846\n\n8033\n7540\n9200\n10554\n2572\n2148\n7195\n9335\n\n6923\n4006\n5057\n1209\n5025\n4788\n2977\n3924\n1149\n5407\n3240\n4363\n2870\n\n18428\n1484\n6717\n\n21437\n10877\n\n13896\n13142\n14976\n4279\n7760\n\n3736\n3606\n6255\n1070\n4078\n1204\n4140\n5864\n5772\n3706\n4794\n1810\n3891\n\n7568\n9015\n8576\n9630\n4006\n8770\n7403\n7606\n8039\n\n3523\n5469\n4603\n7988\n6196\n6253\n7393\n7866\n1976\n8036\n1708\n\n23475\n\n58206\n\n8598\n4206\n7981\n1145\n8057\n3214\n2519\n4155\n6886\n7736\n\n10064\n5532\n4310\n\n5605\n6163\n3079\n5633\n7550\n1557\n3957\n3829\n8064\n5976\n\n14566\n2324\n11737\n8884\n\n5741\n9973\n5120\n8385\n6468\n6446\n\n12939\n7370\n11204\n3902\n\n6531\n6059\n3199\n4544\n2988\n6196\n5805\n2947\n6562\n6497\n5311\n1092\n3929\n\n2969\n5314\n5341\n7533\n1601\n9340\n1458\n4516\n1911\n\n18278\n17057\n19676\n13319\n\n1740\n1218\n7693\n7610\n1179\n2611\n2494\n1995\n2606\n3634\n4818\n\n51246\n\n7826\n5544\n5835\n5983\n5180\n7833\n8681\n7170\n1166\n7254\n\n2013\n4870\n1732\n5678\n5275\n4257\n3686\n6372\n6335\n2539\n1566\n3028\n1304\n3809\n\n4410\n6375\n5386\n7307\n2385\n6675\n1443\n5057\n4051\n5263\n4460\n\n3437\n4993\n6230\n2211\n6522\n4888\n5539\n4875\n4449\n3257\n1333\n3603\n\n1433\n4953\n4098\n10882\n8320\n11840\n10795\n\n6925\n7292\n9340\n2198\n1406\n2490\n5490\n6380\n6512\n\n4332\n2273\n3506\n6399\n3161\n2458\n4217\n2567\n4582\n2109\n4513\n5392\n\n2597\n7554\n9150\n5701\n8972\n7443\n6788\n3224\n\n6098\n7293\n6994\n8305\n7896\n2339\n3312\n7702\n3616\n\n55975\n\n2514\n10887\n\n7264\n10835\n21533\n\n6666\n1428\n6668\n7673\n2755\n3344\n5937\n6942\n7279\n7284\n3344\n\n4809\n\n4748\n7859\n5322\n3460\n3728\n2462\n7973\n1576\n\n1207\n1949\n2608\n1448\n2317\n3410\n7804\n2404\n9159\n\n38251\n\n10983\n5513\n9496\n7341\n11958\n7265\n\n10483\n7081\n5477\n12178\n\n8421\n13928\n7231\n10781\n11620\n\n7219\n2204\n5179\n5011\n4139\n2160\n6130\n1902\n5293\n8458\n\n13895\n10711\n10857\n14214\n\n9062\n4001\n8483\n4260\n9408\n\n8856\n2473\n4738\n9554\n1238\n6186\n1747\n6853\n8308\n\n6468\n5359\n8925\n7929\n9055\n6194\n4431\n4177\n\n1452\n2594\n5079\n6108\n7286\n6997\n1052\n4952\n2458\n5843\n3390\n\n59084\n\n4350\n2892\n6057\n6449\n3274\n4882\n2824\n2625\n2761\n6381\n1803\n2641\n6303\n3518\n\n4595\n15941\n14489\n12371\n13428\n\n6748\n3113\n13130\n13855\n10202\n\n4461\n4550\n3781\n5173\n2232\n3067\n3125\n3914\n5166\n4059\n1403\n1913\n2538\n5819\n\n5492\n2956\n6397\n5485\n3908\n1764\n2853\n2690\n2751\n6816\n6510\n5134\n2251\n\n1912\n11885\n9792\n9026\n\n15319\n21333\n4765\n\n1510\n1760\n1193\n5378\n5539\n1362\n3155\n6051\n3748\n5010\n4280\n1834\n5830\n1273\n2963\n\n2625\n5173\n2499\n5779\n3165\n2148\n2098\n4888\n2787\n5898\n3977\n2740\n2160\n1791\n2522\n\n20725\n\n15813\n26702\n\n1464\n3116\n7046\n5531\n13731\n\n4178\n4204\n3722\n2109\n1772\n3920\n2560\n4029\n5846\n4360\n4538\n4889\n2312\n1086\n1093\n\n1020\n3213\n1017\n3650\n4290\n2888\n4208\n2723\n4149\n2381\n3332\n1308\n2755\n4357\n\n3010\n5317\n1507\n5472\n2171\n6005\n4331\n5355\n3211\n3797\n3963\n3738\n1899\n3390\n1455\n\n2098\n6531\n3206\n4272\n7461\n5093\n5370\n5502\n1543\n4543\n5069\n3491\n\n3195\n3617\n1509\n2926\n1668\n5901\n5893\n3950\n2428\n2572\n2390\n4899\n2234\n3937\n3111\n\n6510\n1964\n6255\n1875\n5118\n3782\n3884\n5480\n2808\n4666\n2827\n3088\n3182\n3470\n\n7230\n5126\n5584\n4880\n7753\n6132\n4098\n2893\n3148\n4209\n3646\n\n2971\n2439\n2362\n6416\n5306\n2714\n4752\n6354\n4807\n3723\n4143\n6503\n\n8492\n19004\n6323\n\n5999\n7828\n7411\n4296\n8321\n5238\n5709\n5631\n6110\n1128\n\n6126\n7809\n1458\n15754\n3603\n\n8908\n8693\n8558\n3270\n5458\n12906\n\n2463\n7423\n6250\n2029\n15528\n\n5146\n6644\n1905\n6828\n2572\n4226\n6264\n4324\n3369\n5999\n5373\n5591\n6634\n\n2053\n7877\n2218\n2415\n2090\n6433\n8607\n3502\n8313\n2841\n\n5471\n5190\n4424\n5184\n3040\n5373\n4799\n8122\n1038\n\n4988\n2833\n4461\n2976\n1168\n5195\n1043\n2270\n7339\n7435\n7226\n5779\n\n11587\n6728\n6765\n11498\n4711\n3547\n\n2878\n8426\n11717\n8591\n5481\n10803\n11181\n\n4915\n2093\n6057\n6957\n13009\n12971\n\n17979\n3250\n19984\n\n5650\n5756\n3307\n10549\n6717\n9579\n2849\n6885\n\n2609\n2347\n4692\n5000\n5068\n5148\n4337\n4316\n2654\n2221\n1822\n\n13157\n\n10140\n5075\n10446\n2946\n5902\n5856\n8096\n8762\n\n16951\n9118\n17962\n\n7524\n4389\n3716\n3580\n5930\n1197\n3233\n6070\n4612\n2477\n6792\n\n6403\n11307\n10753\n9665\n4919\n6485\n3189\n\n8790\n10424\n8816\n3840\n6236\n5529\n8946\n3864\n\n1370\n4810\n3752\n1664\n1247\n3227\n4605\n4906\n5436\n4534\n4722\n4104\n5629\n4962\n3203\n\n2120\n4830\n2859\n2828\n3020\n5260\n5795\n3286\n5247\n6126\n4156\n3624\n2730\n\n58973\n\n18871\n8511\n\n13088\n1608\n12123\n5162\n9357\n2409\n\n3194\n2605\n8440\n9642\n9067\n5709\n4431\n5553\n\n10532\n36332\n\n7227\n10011\n7519\n4030\n7444\n2693\n3845\n\n10004\n5735\n9671\n3576\n7111\n1292\n10428\n2800\n\n4229\n6072\n3748\n1466\n2305\n2664\n2612\n5054\n2625\n2778\n2712\n2788\n5133\n\n10716\n11271\n11169\n9815\n1641\n1025\n\n3016\n3916\n6618\n4213\n6968\n3525\n1944\n6525\n1920\n8741\n\n19472\n\n15684\n10706\n14780\n15411\n9358\n\n5290\n8167\n5269\n7051\n2848\n3948\n5987\n4844\n7749\n5696\n\n9032\n12663\n11173\n14750\n\n1121\n2123\n6582\n5753\n6358\n2524\n6486\n2259\n2197\n1883\n3005\n2406\n5967\n"}; char *zombiestringptr = zombiestring; bool go = true; char checker; int arraypointer = 0; int arraypointerbackup = 0; // int newlinecount = 0; int elfcount = 0; int elf[40000]; printf(zombiestring); while (go == true) { checker = zombiestring[arraypointer]; if (checker == '\0') { puts("nulterminator found"); elf[elfcount] += atoi(zombiestringptr+arraypointerbackup); printf("elf 0: %d\nelf 1: %d\nelf 2: %d\nelf 3: %d\nelf 4: %d\n\nelfcount: %d\n", elf[0], elf[1], elf[2], elf[3], elf[4], elfcount); arraypointer = 1; arraypointerbackup = 0; while(arraypointer <= elfcount) { if (elf[arraypointer] > elf[arraypointerbackup]) { arraypointerbackup = arraypointer; arraypointer++; } else { arraypointer++; } } printf("the elf with the most is elf: %d with %d calories", arraypointerbackup, elf[arraypointerbackup]); return 0; } if (checker == '\n') { zombiestring[arraypointer] = '\0'; elf[elfcount] += atoi(zombiestringptr+arraypointerbackup); arraypointer++; if (zombiestring[arraypointer] == '\n') { elfcount++; arraypointer++; } arraypointerbackup = arraypointer; } else { arraypointer++; } } return 0; }